Using more declarative way to create array in nodeListToArray

This commit is contained in:
Siarhei
2018-09-05 18:31:52 +04:00
parent 973ee405fc
commit e6c1427412
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