Answer:
The for-in loop is used to loop through the properties of an object.
The syntax for the for-in loop is -
for (variable name in object){
statement or block to execute
}
In each repetition, one property from the object is associated to the variable name, and the loop is continued till all the properties of the object are depleted.
The syntax for the for-in loop is -
for (variable name in object){
statement or block to execute
}
In each repetition, one property from the object is associated to the variable name, and the loop is continued till all the properties of the object are depleted.
Previous Question | Next Question |
What is the use of Push method in JavaScript? | What is the difference between .call() and .apply()? |