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
course content

Course Content

Introduction to JavaScript

Introduction to JavaScript

1. JavaScript Fundamentals
2. Variables and Data Types in JavaScript
3. Performing Operations in JavaScript
4. Controlling Program Flow with Conditional Statements
5. Looping Through Data in JavaScript
6. Functions in JavaScript

book
Challenge: 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:

python
  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
We're sorry to hear that something went wrong. What happened?
some-alt