Easing you into what lies beyond a `For Loop`

For was nice while it lasted, but it’s about time that i = 0 and we move on and learn something new. Let me introduce you to its buddy and your first foray into big kid iteration, .forEach().

I could show you what MDN says, but I imagine you’re here because you’d rather not. That being the case, I’m also going to steer away from using ESMAScript6 and my favorite thicc boi arrows () => in lieu of the more familiar function().

Image for post
Image for post

Side by Side: for & forEach

Let’s have a look back at a for loop. Below is one of those iterating through an array of very maturely labeled string


Image for post
Image for post

Front end or back end, let me be the first to offer both congratulations and condolences.

Surely, there has been no shortage to the good people who, for better or for worse, have informed you of how difficult your developer education will be. I will add to that. It will be difficult, and depending on where you attend, perhaps the most difficult educational experience you’ve experienced to date.

You will have days where you feel as if you’re a god. You will have days where you realize that, if indeed I am a god, then surely my domain is meager, and ultimately the property of a greater god who has thusly created me, and perhaps without much thought. …

About

Scott Brabson

Front End Dev student at Turing School

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store