I\'m a big fan of using the forEach method on nodeLists like this:
var nodes = document.querySelectorAll(\".foo\"); [].forEach.call(nodes, function (item) {
It depends on the browser. And don't forget about while() which is the fastest on Firefox 4. Here's a comparison.
Also keep in mind that if you're supporting older browsers that don't support forEach, you need to add in the time it takes to implement a polyfill.