Which of the following loop instructions is intended only to loop through all the keys of the indicated object?

  • Post author:
  • Post category:Q&A
  • Reading time:1 min read
  • Post last modified:March 15, 2025

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.

For more Questions and Answers:

JavaScipt Essentials 1 (JSE) | JSE1 – Module 4 Test Exam Answers Full 100%