Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Task: Printing a Sequence | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
JavaScript Essentials for Beginners - 1768407374405

bookTask: Printing a Sequence

Uppgift

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).

Lösning

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 68
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

close

bookTask: Printing a Sequence

Svep för att visa menyn

Uppgift

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).

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 68
single

single

some-alt