Loops in Java Script

  Loops in Java Script


Loops are used to execute a block of code repeatedly. In JavaScript, you can use for and while loops.


Here's an example of a for loop that prints the numbers 1 to 10:


css


for (var i = 1; i <= 10; i++) {

  console.log(i);

}

No comments:

Post a Comment

The Importance of Cybersecurity in the Digital Age

 The Importance of Cybersecurity in the Digital Age Introduction: In today's digital age, where technology is deeply intertwined with ev...