Not sure why you spent 4 hours on that, in addition to the other response there's also this method, which lets you call map on it and also call all the methods available to NodeList (you'd lose access to those if you converted it to an array)
var classNames = [].map.call(nodeList, (entry) => entry.className)
The 'call' function in java script allows you to specify the "this" in the calling of the function. So we grab the map function from an empty array, and call it with nodeList as "this". You can find out more here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...You could also use that to make a super simple method to allow you to call map on any array like object, then you can import this into your other files:
function map(arr, callback) {
return Array.prototype.map.call(arr, callback);
}
Then call it like
var classNames = map(nodeList, (node) => node.className);