Challenge: Print Numbers from 5 to 9
Task
Let's implement a while loop that outputs numbers from 5 to 9 to the console.
9
1
2
3
4
5
6
let a = 5;
___ (a ___ ___) {
console.log(___);
___++;
};
123456let a = 5; ___ (a ___ ___) { console.log(___); ___++; };
The output should be:
python91234556789
Set the condition to a
<= 9
ora < 10
.Include the variable
a
within theconsole.log()
function.Increment the value of
a
inside the loop.
9
1
2
3
4
5
6
let a = 5;
while (a <= 9) {
console.log(a);
a++;
}
123456let a = 5; while (a <= 9) { console.log(a); a++; }
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 5. Capítulo 3
Pregunte a AI
Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla