Challenge: Print Numbers from 5 to 9
Task
Let's implement a while loop that outputs numbers from 5 to 9 to the console.
123456let a = 5; ___ (a ___ ___) { console.log(___); ___++; };
The output should be:
5
6
7
8
9
- Set the condition toΒ a
<= 9Β orΒa < 10. - Include the variableΒ
aΒ within theΒconsole.log()Β function. - Increment the value ofΒ
aΒ inside the loop.
123456let a = 5; while (a <= 9) { console.log(a); a++; }
Everything was clear?
Thanks for your feedback!
SectionΒ 5. ChapterΒ 3
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 2.33
Challenge: Print Numbers from 5 to 9
Swipe to show menu
Task
Let's implement a while loop that outputs numbers from 5 to 9 to the console.
123456let a = 5; ___ (a ___ ___) { console.log(___); ___++; };
The output should be:
5
6
7
8
9
- Set the condition toΒ a
<= 9Β orΒa < 10. - Include the variableΒ
aΒ within theΒconsole.log()Β function. - Increment the value ofΒ
aΒ inside the loop.
123456let a = 5; while (a <= 9) { console.log(a); a++; }
Everything was clear?
Thanks for your feedback!
SectionΒ 5. ChapterΒ 3