KA JS Loops

KA JS Loops

KG - University

5 Qs

quiz-placeholder

Similar activities

Logical Operator

Logical Operator

7th Grade

9 Qs

bài tập 11 tiết 7

bài tập 11 tiết 7

11th Grade

10 Qs

Python Beginner

Python Beginner

12th Grade

10 Qs

Basics of Javascript

Basics of Javascript

9th - 12th Grade

10 Qs

Flutter_Q1 G4

Flutter_Q1 G4

Professional Development

8 Qs

JavaScript Loop

JavaScript Loop

KG - University

5 Qs

ÔN TẬP HKI TIN 8 (2)

ÔN TẬP HKI TIN 8 (2)

8th Grade

10 Qs

Reference and Pointers in C++

Reference and Pointers in C++

6th - 8th Grade

10 Qs

KA JS Loops

KA JS Loops

Assessment

Quiz

Computers

KG - University

Hard

Used 153+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these is not a type of loop in JavaScript?
while
for
repeat

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these expressions is NOT a valid way to add 1 to a variable in JavaScript?
x++
x += 1
x = x + 1
x+

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Let's say you have an x variable that starts as 0. If you want your while loop to stop once the x variable equals 400, what condition would you use?
x < 400
x > 400
x == 400
x >= 400

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Let's say you want to repeat a shape 20 times. Which for loop would help you code that?
for (var i = 1; i < 20; i++) { } 
for (var i = 0; i <= 20; i++) { } 
for (var i = 0; i < 20; i++) { } 
for (var i = 0; i > 20; i++) { } 

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Let's say you want to repeat a shape horizontally across the 400x400 canvas, with 40 pixels between each shape. Which for loop would help you code that?
for (var x = 0; x > 400; x += 40) { } 
for (var x = 0; x < 400; x += 40) { } 
for (var x = 0; x < 400; x++) { } 
for (var x = 0; x > 400; x++) { }