DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 963,274 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Mike
Mike

Posted on

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 (3)

Collapse
 
rkarroll profile image
rkarroll

Mike, this is awesome and hilarious.

Collapse
 
bugmagnet profile image
Bruce Axtens

Nomenclature. A burden, lightened somewhat. Thank you.

🌱 DEV runs on 100% open source code that we started called Forem.

You can contribute to the codebase or host your own.