30 seconds of code

  Back to Home

nodeListToArray

browserarraybeginner

Converts a NodeList to an array.

Use spread operator inside new array to convert a NodeList to an array.

const nodeListToArray = nodeList => [...nodeList];