Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Tigers | Loops
Introduction to JavaScript
course content

Contenido del Curso

Introduction to JavaScript

Introduction to JavaScript

1. Basic Concepts
2. Variables and Data Types
3. Basic Operations
4. Conditional Statements
5. Loops
6. Functions

bookChallenge: Tigers

Task

Implement a for loop that outputs the word "Tiger" exactly 5 times.

12345
let tiger = "___"; ___ (let ___ = 0; i < ___; ___) { console.log(___); };
copy

The output should be:

  1. Begin by assigning the value "Tiger" to the variable tiger.
  2. Utilize the for keyword to create the loop.
  3. Initialize the counter variable i.
  4. Set the range for the counter i to go from 0 to 4 (5 loop iterations: 0, 1, 2, 3, 4).
  5. Include the increment operation (++) for the i counter.
  6. Place the tiger variable inside the console.log() function.
12345
let tiger = "Tiger"; for (let i = 0; i < 5; i++) { console.log(tiger); };
copy

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 5. Capítulo 5
some-alt