Use [] to find tag! Example: [flutter, javascript]

Javascript made easy
Javascript made easy

Chapter 4

Looping For

remove_red_eye 1887 Times
spellcheck 113 Words, 659 Characters
*Note: this book is still ongoing until it has a finished label.

Looping for is used to loop without data having to be declared first.

Example of looping

for (i = 0 ; i 

the output of the above code is numbers 0 - 99

Code Discussion

1. i = 0; this reveals that the loop starts at number 0

2. i this specifies that the loop stops before the number 100.

3. i++ this explains about increment, so the variable i will be added with the number 1 in every iteration.

4. console.log(i); is outputting the value i every time it loops.

Practice

To hone our logic, here I give a simple example to make repeating even numbers. An even number is a number that is divisible by 2.

An example of creating an even number:

Good luck

Next Article (For of)
Content Navigation