
JavaScript Basics
Authored by amit Xalxo
Computers
KG
Used 14+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
22 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What keyword is used to declare a variable in JavaScript?
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}
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
ICT Quiz - Primary 2
Quiz
•
2nd Grade
20 questions
X-Tech Riot
Quiz
•
1st Grade
20 questions
list 6th
Quiz
•
7th Grade - University
20 questions
New Scratch
Quiz
•
6th - 8th Grade
17 questions
Traffic Light Project Quiz
Quiz
•
9th Grade
20 questions
Cloud Review Quiz
Quiz
•
University
20 questions
Pretest
Quiz
•
10th Grade
20 questions
AI BootCamp: 2024 Edition- Session 1
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
Discover more resources for Computers
4 questions
Conflict Resolution
Lesson
•
KG
20 questions
Place Value
Quiz
•
KG - 3rd Grade
20 questions
CVC Words
Quiz
•
KG - 1st Grade
24 questions
CKLA Unit 5 assessment K
Quiz
•
KG
10 questions
STAAR Review - Editing & Revising Clusters
Quiz
•
KG
10 questions
Reflexive Pronouns
Quiz
•
KG - 5th Grade
10 questions
Long i- igh, ie, and y Quiz
Quiz
•
KG - 3rd Grade
12 questions
Quarter Past, Half Past, and Quarter To
Quiz
•
KG - 12th Grade