JavaScript Required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Loops en JavaScript
1. What is a Loop?
2. while Loop
3. do while Loop
4. Add One to a Number with the Increment Operator (++)
5. Challenge Loop
6. Bewere of Infinite Loops!
7. Evaluación Loops
8. for loop
9. Dynamically Display HTML with a Loop
10. Exit a Loop
11. The refactor Challenge
12. Challenge Task
More
Share
Explore
8. for loop
Antes hacíamos esto:
Ahora podemos escribirlo así:
for ( let i = 0; i < 10; i++ ) {
console.log(`El número aleatorio es: ${getRandomNumber(200)}`);
}
Obtenemos:
Challenge 1
Create a
for
loop that logs the numbers
5
to
100
to the console. Use the
console.log()
method to log a value to the console.
for (let i=0; i <= 100-5; i++) {
console.log(5+i);
}
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.