en.javascript.info/1-js/02-first-steps/13-while-for/5-replace-for-while/task.md

238 B

importance: 5


Replace "for" with "while"

Rewrite the code changing the for loop to while without altering its behavior (the output should stay same).

for (let i = 0; i < 3; i++) {
  alert( `number ${i}!` );
}