Have you ever had a situation where you needed to perform a step repeatedly for a fixed number of times such as repeating a song fixed number of times in dance practice, or setting the alarm to wake you up every day? Well, in programming there will arise a lot of times where you’ll need to perform redundant tasks. So, how do you tackle such cases? JavaScript uses something called as loops for such purposes. Let’s learn more about it in detail in the next video.
So you saw how complicated situations can be broken down into a series of smaller repeated tasks. Let’s now understand how to write these loops in JavaScript.