Which of the following loop instructions checks the loop continuation condition only after the iteration has been completed?

  • Post author:
  • Post category:Blog
  • Post last modified:March 7, 2024
  • Reading time:1 mins read

Which of the following loop instructions checks the loop continuation condition only after the iteration has been completed?

  • for ... in
  • while
  • for
  • do ... while
Explanation & Hint:

The “do … while” loop instruction checks the loop continuation condition only after the iteration has been completed. In the “do … while” loop, the code block is executed first, and then the condition is checked. If the condition evaluates to true, the loop continues executing. This guarantees that the code block is executed at least once, regardless of the condition.

For more Questions and Answers:

JavaScript Essentials 1 | JSE1 – Final Test Exam Answers Full Score 100%