2 ms·
> Actually, the forEach version can end up faster than the let version... Theoretically maybe, but I've yet to see that. A regular `for(;;)` is generally 3-5 t
by masklinn 15y ago
> Actually, the forEach version can end up faster than the let version...
Theoretically maybe, but I've yet to see that. A regular `for(;;)` is generally 3-5 times faster than using `Array.prototype.forEach`.
Re. JIT, hand-rolling a foreach in javascript can be up to twice as fast as the native one, depending on the features you leave out.
- bzbarsky 15y ago> Theoretically maybe, but I've yet to see that Compare the let version to the code in https://bugzilla.mozilla.org/show_bug.cgi?id=602132 https://bugzilla.mozilla.org/show_bug.cgi?id=602132