JS Built-ins
ControlFlowintermediate

do...while Loop

A do...while loop executes its body at least once before checking the condition. Use it when you need guaranteed first execution. Example: prompting a user until they enter valid input.

πŸ’‘ Hints (3)
  • β€’ do { ... } while (condition) β€” body runs first, then condition is checked
  • β€’ Push count to results, then increment count
  • β€’ The loop continues while count < limit