
Kuizi 14 - Web

Quiz
•
Computers
•
10th Grade
•
Hard
Shkodran Hasani
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the basic syntax of a for loop in JavaScript?
for (initialization; condition) { // code to be executed }
for (initialization; increment) { // code to be executed }
for (condition; initialization; increment) { // code }
for (initialization; condition; increment) { // code to be executed }
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare a while loop in JavaScript?
do { // code to be executed } while (condition)
while { condition; // code to be executed }
for (condition) { // code to be executed }
while (condition) { // code to be executed }
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main difference between a while loop and a do-while loop?
Both loops execute the same number of times regardless of the condition.
A while loop is used for iterating over arrays, while a do-while loop is used for conditional statements.
The main difference is that a while loop may not execute at all if the condition is false, while a do-while loop always executes at least once.
A while loop always executes at least once, while a do-while loop may not execute at all.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can you provide an example of a nested loop in JavaScript?
for (let i = 0; i < 3; i++) { for (let j = 0; j < 2; j++) { console.log(i, j); }}
for (let j = 0; j < 3; j++) { for (let i = 0; i < 2; i++) { console.log(j); }}
for (let i = 0; i < 2; i++) { for (let j = 0; j < 3; j++) { console.log(i + j); }}
for (let i = 0; i < 5; i++) { console.log(i); }
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What keyword is used to exit a loop prematurely?
continue
exit
return
break
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How does the for loop iterate through an array?
The for loop randomly selects elements from the array.
The for loop only accesses the first element of the array.
The for loop iterates through the array in reverse order.
The for loop accesses each element of the array using an index that increments from 0 to the length of the array minus one.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code: for(let i = 0; i < 5; i++) { console.log(i); }?
-1
0 1 2 3 4
5
10
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
C++ Quiz

Quiz
•
University
20 questions
Apple Swift Playgrounds: Learn to Code 1 Vocabulary (Lessons 0 - 6)

Quiz
•
9th - 12th Grade
16 questions
Loops

Quiz
•
5th - 12th Grade
16 questions
Computer Science 2.2

Quiz
•
10th Grade
10 questions
Code.org Unit 5 - Loops

Quiz
•
9th - 12th Grade
17 questions
Flow of Control in C++ ( Conditional statements)

Quiz
•
9th Grade - University
10 questions
Weekly Contest #6 - TechXNinjas

Quiz
•
University
10 questions
REVIEW QUIZ FOR & WHILE LOOP

Quiz
•
10th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
10 questions
Characteristics of Life

Quiz
•
9th - 10th Grade
10 questions
Essential Lab Safety Practices

Interactive video
•
6th - 10th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade