88.8k views
0 votes
Someone, please answer this.

This lesson showed you the general form of the syntax for a for loop in JavaScript:for

(initialize counter; condition; update counter) {code block;}

What does each part do, and why is it necessary?

User Umesha MS
by
4.1k points

1 Answer

3 votes

Answer: A loop will continue running until the defined condition returns false . ... You can type js for , js while or js do while to get more info on any of these. ... initialization - Run before the first execution on the loop. ... But it can be used to decrement a counter too. statement - Code to be repeated in the loop.

Explanation:

User Xgretsch
by
4.3k points