js merge 2 index declarations for loop 1

js merge 2 index declarations for loop

// merges 2 index declarations

for (var i = 0, j = 50; i <= 50; i++, j--) {
  //...
}

Here is what the above code is Doing:
1. Declare a variable i and initialize it to 0.
2. Declare a variable j and initialize it to 50.
3. Check if i is less than or equal to 50. If it is, execute the code block.
4. Execute the code block.
5. Increment i by 1.
6. Decrement j by 1.
7. Go back to step 3.

Similar Posts