What keyword is used to declare a variable in JavaScript?
JavaScript Basics

Quiz
•
Computers
•
KG
•
Hard
amit Xalxo
Used 13+ times
FREE Resource
22 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
var
function
let
const
Answer explanation
The keyword 'let' is used to declare a variable in JavaScript.
2.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Which loop is used to iterate over an array in JavaScript?
while
switch
if
for
Answer explanation
The correct loop used to iterate over an array in JavaScript is the 'for' loop.
3.
MULTIPLE SELECT QUESTION
10 sec • 1 pt
What symbol is used for strict equality comparison in JavaScript?
===
=/=
!==
===
Answer explanation
The symbol used for strict equality comparison in JavaScript is '===' which checks both value and type.
4.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
How do you write an 'if' statement in JavaScript?
if (condition) // code block
if [condition] { // code block }
if (condition) { // code block }
if (condition) { /* code block */ }
Answer explanation
In JavaScript, the correct way to write an 'if' statement is: if (condition) { // code block }
5.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What is the result of 10 + '5' in JavaScript?
501
105
50
15
Answer explanation
In JavaScript, when adding a number to a string, the number is converted to a string and concatenated. Therefore, 10 + '5' results in '105'.
6.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What is the purpose of the 'for' loop in JavaScript?
To iterate over a block of code multiple times
To change the font color of a webpage
To calculate complex mathematical equations
To play music in the background
Answer explanation
The 'for' loop in JavaScript is used to iterate over a block of code multiple times, making it the correct choice.
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What is the syntax for the 'switch' statement in JavaScript?
switch(expression) { case value1: // code block break; case value2: // code block break; ... default: // code block }
switch(expression) { case value1: // code block break; case value2: // code block break; ... default: // code block}
switch(expression) { case value1: // code block break; case value2: // code block break; ... default: // code block
switch{expression} case value1: // code block break; case value2: // code block break; ... default: // code block
Answer explanation
The correct syntax for the 'switch' statement in JavaScript is: switch(expression) { case value1: // code block break; case value2: // code block break; ... default: // code block}
Create a free account and access millions of resources
Similar Resources on Quizizz
20 questions
JavaScript Basics CodeHS

Quiz
•
7th - 12th Grade
20 questions
JavaScript Basics Test

Quiz
•
10th - 12th Grade
21 questions
CodeHS JavaScript

Quiz
•
8th - 12th Grade
21 questions
Scratch

Quiz
•
3rd Grade
17 questions
Fundamentals of Computing Vocab. Part 1

Quiz
•
9th - 11th Grade
18 questions
Javascript Arrays

Quiz
•
5th Grade
17 questions
Java programming

Quiz
•
Professional Development
20 questions
JavaScript Basics (2)

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Identifying equations

Quiz
•
KG - University
15 questions
Music 2016

Quiz
•
KG - 12th Grade
44 questions
logos

Quiz
•
KG - University
20 questions
Disney Characters

Quiz
•
KG
20 questions
Kids shows

Quiz
•
KG
20 questions
Guess that Disney

Quiz
•
KG - 5th Grade
20 questions
Cartoon Characters!

Quiz
•
KG - 5th Grade