Using javascript loops?

Example:


  for (let i = 0; i < 5; i++) {
      console.log(i);  
  }
  

Solution:

JavaScript provides several ways to loop over data structures. The for loop, as shown in the example, is one of the most common looping structures in JavaScript.

Beginner's Guide to JavaScript