from nodelist to array javascript code example
Example 1: turn nodelist into array
Array.prototype.slice.call(document.childNodes);
Example 2: js convert nodelist to array
// Get all buttons as a NodeList
var btns = document.querySelectorAll('button');
// Convert buttons NodeList to an array
var btnsArr = Array.from(btns);