Convertir htmlCollection a matriz
const boxes = Array.from(document.getElementsByClassName('box'));
Lucky Locust
const boxes = Array.from(document.getElementsByClassName('box'));
//Use the Array.from() method to convert a nodelist or HTMLcollection into an array.
let elements = document.getElementsByClassName("classnameHere");
let arrayOfElements = Array.from(elements);
//Now arrayOfElements is iterable with methods such as .forEach().
var children = [].slice.call(document.getElementById(...).children);
const boxArray = [...document.getElementsByClassName('box')];
Array.from(elements);
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<script>
const boxes = document.getElementsByClassName('box');
</script>