3 ms·
Lots of work went into making the perf of for(of) fast - after the initial “make it semantically correct” bits. There are many reasons it is faster, but it als
by olliej 9y ago
Lots of work went into making the perf of for(of) fast - after the initial “make it semantically correct” bits.
There are many reasons it is faster, but it also has the nice property of working sensibly on any iterable object rather than forEach that only iterates by index, and has an annoying ‘if (index in object)’ in the loop.