Using more declarative way to create array in nodeListToArray

This commit is contained in:
Siarhei
2018-09-05 18:31:52 +04:00
parent f87902bd47
commit c76e8a8ff4
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ Converts a `NodeList` to an array.
Use `Array.prototype.slice()` and `Function.prototype.call()` to convert a `NodeList` to an array.
```js
const nodeListToArray = nodeList => Array.prototype.slice.call(nodeList);
const nodeListToArray = nodeList => [...nodeList];
```
```js

View File

@ -1,2 +1,2 @@
const nodeListToArray = nodeList => Array.prototype.slice.call(nodeList);
const nodeListToArray = nodeList => [...nodeList];
module.exports = nodeListToArray;