SyntaxFix
Write A Post
Hire A Developer
Questions
I know this question is old -- but here's another, extremely simple solution ...
var elements = Array.from(document.querySelectorAll("div"));
Then it can be used like any, standard array.