From c76e8a8ff4192084a9322d400ec865cf52e1957c Mon Sep 17 00:00:00 2001 From: Siarhei Date: Wed, 5 Sep 2018 18:31:52 +0400 Subject: [PATCH] Using more declarative way to create array in nodeListToArray --- snippets/nodeListToArray.md | 2 +- test/nodeListToArray/nodeListToArray.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/nodeListToArray.md b/snippets/nodeListToArray.md index d5c8713d1..22b408ce0 100644 --- a/snippets/nodeListToArray.md +++ b/snippets/nodeListToArray.md @@ -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 diff --git a/test/nodeListToArray/nodeListToArray.js b/test/nodeListToArray/nodeListToArray.js index 0b834e1ae..2fc92fad0 100644 --- a/test/nodeListToArray/nodeListToArray.js +++ b/test/nodeListToArray/nodeListToArray.js @@ -1,2 +1,2 @@ -const nodeListToArray = nodeList => Array.prototype.slice.call(nodeList); +const nodeListToArray = nodeList => [...nodeList]; module.exports = nodeListToArray;