Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Console Tigers with Loops | Looping Through Data in JavaScript
Introduction to JavaScript

bookChallenge: Console Tigers with Loops

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:

Tiger
Tiger
Tiger
Tiger
Tiger
  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

Everything was clear?

How can we improve it?

Thanks for your feedback!

Sectionย 5. Chapterย 5

Ask AI

expand

Ask AI

ChatGPT

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

Awesome!

Completion rate improved to 2.33

bookChallenge: Console Tigers with Loops

Swipe to show menu

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:

Tiger
Tiger
Tiger
Tiger
Tiger
  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

Everything was clear?

How can we improve it?

Thanks for your feedback!

Sectionย 5. Chapterย 5
some-alt