# JavaScript For Loop
● JavaScript Loops
Loops are handy, if programmer want to run the same code over and over again, each time with a different value.
Often this is the case when working with arrays.
Often this is the case when working with arrays.
● Different Kinds of Loops
JavaScript supports different kinds of loops.
- for - loops through a block of code a number of times
- for/in - loops through the properties of an object
- while - loops through a block of code while a specified condition is true
- do/while - also loops through a block of code while a specified condition is true
● The For Loop
The For loop is often the tool programmer will use when he want to create a loop.
● The For/In Loop
The JavaScript for/in statement loops through the properties of an object.
No comments:
Post a Comment