Challenge: Console Tigers with Loops
Task
Implement a for
loop that outputs the word "Tiger" exactly 5 times.
12345let tiger = "___"; ___ (let ___ = 0; i < ___; ___) { console.log(___); };
The output should be:
Tiger
Tiger
Tiger
Tiger
Tiger
- Begin by assigning the value "Tiger" to the variableย
tiger
. - Utilize theย
for
ย keyword to create the loop. - Initialize the counter variableย
i
. - Set the range for the counterย
i
ย to go fromย0
ย toย4
ย (5 loop iterations: 0, 1, 2, 3, 4). - Include the increment operation (
++
) for theยi
ย counter. - Place theย
tiger
ย variable inside theยconsole.log()
ย function.
12345let tiger = "Tiger"; for (let i = 0; i < 5; i++) { console.log(tiger); };
Everything was clear?
Thanks for your feedback!
Sectionย 5. Chapterย 5
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: Console Tigers with Loops
Swipe to show menu
Task
Implement a for
loop that outputs the word "Tiger" exactly 5 times.
12345let tiger = "___"; ___ (let ___ = 0; i < ___; ___) { console.log(___); };
The output should be:
Tiger
Tiger
Tiger
Tiger
Tiger
- Begin by assigning the value "Tiger" to the variableย
tiger
. - Utilize theย
for
ย keyword to create the loop. - Initialize the counter variableย
i
. - Set the range for the counterย
i
ย to go fromย0
ย toย4
ย (5 loop iterations: 0, 1, 2, 3, 4). - Include the increment operation (
++
) for theยi
ย counter. - Place theย
tiger
ย variable inside theยconsole.log()
ย function.
12345let tiger = "Tiger"; for (let i = 0; i < 5; i++) { console.log(tiger); };
Everything was clear?
Thanks for your feedback!
Sectionย 5. Chapterย 5