In JavaScript, what is the best way to convert a NodeList to an array? May 21, 2023 by Tarik With ES6 you can simply do: const spanList = [...document.querySelectorAll("span")];