Which of the following loop instructions is intended only to loop through all the keys of the indicated object?
for ... of
if ... else
for ... in
do ... while
Explanation & Hint:
The loop instruction intended only to loop through all the keys of the indicated object is the “for … in” loop. The “for … in” loop in JavaScript is used to iterate over the properties (keys) of an object. It allows you to loop through each enumerable property of an object and execute a block of code for each property. The loop variable represents each key in the object during each iteration. |