re: Which types of loops are most popular in the programming languages you use? VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Ruby is unique in the “more than one way to do the same thing” and while (no pun intended) for/while loops may not be as common, they were made for...
 

Ruby is not as unique in that respect as you think.

There are not one, not two, but three ways to loop over an array in JavaScript, and that's not counting special cases like map, reduce, or filter. You have classic C-style for loops, 'for...of' loops (iteration), and the callback-based .forEach() approach.

code of conduct - report abuse