Explain the for-in loop?

0

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 with the variable name and the loop is continued till all the properties of the object are depleted.

asked Apr 14, 2023 at 19:16
Sign in to add a comment

0 Answers

0
📝 No answers yet!

Be the first to answer this interview question.

Your Answer

Sign in to post your answer and help the community.