Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Task: Printing a Sequence | Discovering Loops
Introduction to JavaScript

bookTask: Printing a Sequence

Task

Swipe to start coding

Write a program that prints the first ten even numbers.

  • Create a for loop with these parameters:
    • Initialization: start i at 1.
    • Condition: continue the loop while i <= 10.
    • Update: increase i by 1 after each iteration.
  • Inside the loop, use console.log to print the value of i * 2. This will display the first ten even numbers (2, 4, 6, …, 20).

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 6. ChapterΒ 2
single

single

Ask AI

expand

Ask AI

ChatGPT

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

close

Awesome!

Completion rate improved to 1.33

bookTask: Printing a Sequence

Swipe to show menu

Task

Swipe to start coding

Write a program that prints the first ten even numbers.

  • Create a for loop with these parameters:
    • Initialization: start i at 1.
    • Condition: continue the loop while i <= 10.
    • Update: increase i by 1 after each iteration.
  • Inside the loop, use console.log to print the value of i * 2. This will display the first ten even numbers (2, 4, 6, …, 20).

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 6. ChapterΒ 2
single

single

some-alt