Which loop is used for iterating over the properties of an object in JavaScript?
-
A
for loop
-
B
while loop
-
C
do-while loop
-
D
for...in loop
Correct answer
Correct answer
D. for...in loop
16 views
Explanation
The "for...in" loop is specifically designed for iterating over the properties of an object in JavaScript.
Video explanation
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ