Converting a NodeList to an Array in Javascript

Ever wish you could use Array functions on a NodeList returned by element.querySelectorAll or element.childNodes? It’s surprisingly easy!

A NodeList is an Array-Like object that contains a .length field, but lacks useful functions like .forEach and .map that make working with Arrays so easy.

Leave a Comment

Post comment

What is Persona?