Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Print Numbers from 5 to 9 | Looping Through Data in JavaScript
Introduction to JavaScript

bookChallenge: Print Numbers from 5 to 9

Task

Let's implement a while loop that outputs numbers from 5 to 9 to the console.

123456
let a = 5; ___ (a ___ ___) { console.log(___); ___++; };
copy

The output should be:

5
6
7
8
9
  1. Set the condition toΒ a <= 9Β orΒ a < 10.
  2. Include the variableΒ aΒ within theΒ console.log()Β function.
  3. Increment the value ofΒ aΒ inside the loop.
123456
let a = 5; while (a <= 9) { console.log(a); a++; }
copy

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 5. ChapterΒ 3

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

bookChallenge: Print Numbers from 5 to 9

Task

Let's implement a while loop that outputs numbers from 5 to 9 to the console.

123456
let a = 5; ___ (a ___ ___) { console.log(___); ___++; };
copy

The output should be:

5
6
7
8
9
  1. Set the condition toΒ a <= 9Β orΒ a < 10.
  2. Include the variableΒ aΒ within theΒ console.log()Β function.
  3. Increment the value ofΒ aΒ inside the loop.
123456
let a = 5; while (a <= 9) { console.log(a); a++; }
copy

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 5. ChapterΒ 3
some-alt