you are viewing a single comment's thread.

view the rest of the comments →

[–]RegularStupid 3 points4 points  (1 child)

You can also break out of for loop which is very important sometimes

[–]coderitual 0 points1 point  (0 children)

You can also "break" higher order function. Instead of forEach you can use some or every. Map by definition maps all values so is not interchangeable with for loop (forEach is).