Loops, what are they and how are they used in JavaScript?

I wanted to take a step back and cover a fundamental concept in JavaScript. The great thing about loops is that you can easily do something a number of times. Loops are everywhere is JavaScript, which makes sense because we often want to iterate over an array or another data type in order to do some work. There are several different kinds of loops but they more of less all do similar work — they repeat an action any number of times as long as the condition is true.

Erica Ann Basak

Full stack web developer

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