1//Use the Array.from() method to convert a nodelist or HTMLcollection into an array.
2
3let elements = document.getElementsByClassName("classnameHere");
4let arrayOfElements = Array.from(elements);
5
6//Now arrayOfElements is iterable with methods such as .forEach().
1var boxes = Array.prototype.slice.call(document.getElementsByClassName('box'));
2
3var boxes = [].slice.call(document.getElementsByClassName('box'));