Which method is used to loop through all the enumerable properties of an object in
Which method is used to loop through all the enumerable properties of an object in
JavaScript?
Show answerHide answer
Correct answer: (C) for...in
Explanation
The for...in loop iterates over all enumerable property names (keys) of an object. Object.keys() and Object.values() only return arrays, and forEach is an array method.