Q:

Write a JavaScript program to convert a NodeList to an array

0

Write a JavaScript program to convert a NodeList to an array.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

const nodeListToArray = nodeList => Array.prototype.slice.call(nodeList);
console.log(nodeListToArray(document.childNodes));

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now