convert a dom list to array javascript code example Example: javascript querySelectorAll to array const spanList = [...document.querySelectorAll("span")];