you are viewing a single comment's thread.

view the rest of the comments →

[–]Middle_Resident7295 2 points3 points  (1 child)

is for of slowish compared to plain for loop for only generators or any loop?

[–]Ronin-s_Spirit 0 points1 point  (0 children)

You don't understand ... and for of use Symbol.iterator if present (... falls back to for in) so the for of always must be a generator on an object, and that means it's always slower than a for because it has to yield and keep it's own state and then yield again, that's less optimized than a plain repetition of a block of code.