— But really, performance usually isn’t a big concern unless your code is high load
— In that case avoid iterators in general, and only use the standard for loop with the 3 expressions
— That is the fastest loop
— MDN had a line advising against for...of on Arrays
— Okay that's something else
— ForEach locks block in the scope, sometimes useful, sometimes (more often) not
— Sometimes to reuse variable name, if having a
, b
, c
in block, it may be done with a.forEach (a) -> and with for
you have to make var d
Message permanent page