296 B
296 B
nodeListToArray
Converts a NodeList to an array.
Use Array.prototype.slice() and Function.prototype.call() to convert a NodeList to an array.
const nodeListToArray = nodeList => [...nodeList];
nodeListToArray(document.childNodes); // [ <!DOCTYPE html>, html ]