loop through htmlcollection dynamically doesn't exist code example
Example: html collection of elements to array
const boxes = Array.from(document.getElementsByClassName('box'));
const boxes = Array.from(document.getElementsByClassName('box'));