DEV Community

Mike πŸˆβ€β¬›
Mike πŸˆβ€β¬›

Posted on

9 1

Naming Things

So I was implementing a forEach method and asked my co-worker, "is there a name for a for-loop that iterates backwards? Something like:"

for (let i = myObj.length - 1; i >= 0; i--) { ... }
Enter fullscreen mode Exit fullscreen mode

Of course, there wasn't one. So I set out to create one.

Meet rofEach and the rof loop. It's not only the word "for" backwards, it also means "Reverse Order For".

You're welcome, world. πŸŽ€β¬‡οΈ

Top comments (2)

Collapse
 
rkarroll profile image
rkarroll β€’

Mike, this is awesome and hilarious.

Collapse
 
bugmagnet profile image
Bruce Axtens β€’

Nomenclature. A burden, lightened somewhat. Thank you.

Visualizing Promises and Async/Await 🀯

async await

☝️ Check out this all-time classic DEV post

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay