nodelistof element to array code example
Example 1: turn nodelist into array
Array.prototype.slice.call(document.childNodes);
Example 2: nodelist to array
//spread the nodelist into an array
[...nodelist];
Array.prototype.slice.call(document.childNodes);
//spread the nodelist into an array
[...nodelist];