2 ms·
You don't need to call the slice method: Array.prototype.forEach.call(document.querySelectorAll('thing'), function (elem) { value = somevalue; });
by gildas 14y ago
You don't need to call the slice method:
Array.prototype.forEach.call(document.querySelectorAll('thing'), function (elem) { value = somevalue; });
- TazeTSchnitzel 14y agoAnd I could use underscore, a much more general-purpose library than jQuery to help me here, only 4kb. So: _.each(document.querySelectorAll('thing'), function (elem) { value = somevalue; }); (But then I might as well just use jQuery, I guess)