5 ms·
It depends what you're aiming for. For accuracy, map and filter make it impossible to fall off the bounds of your iteration. While it would certainly be nice if
by shadowgovt 3y ago
It depends what you're aiming for. For accuracy, map and filter make it impossible to fall off the bounds of your iteration. While it would certainly be nice if the runtime could do that faster, slow + correct is often (not always) better than fast + broken.
(There are languages that make fast + correct easier. Unfortunately, JavaScript isn't really one of them).
- ragnese 3y agoJavaScript has `for-of` syntax for iterables, so you won't go out of bounds, regardless.