
JavaScript Quiz
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Tyler Newman
Used 1+ times
FREE Resource
Enhance your content in a minute
22 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code print to the console?
developer
"developer"
Naomi
"Naomi"
Answer explanation
The code will print "Naomi" to the console because the string is enclosed in double quotes, indicating a literal string.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a non-primitive data type in JavaScript?
Number
String
Boolean
Array
Answer explanation
The non-primitive data type in JavaScript is Array. Number, String, and Boolean are all primitive data types.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access the first value in an array named 'rows' in JavaScript?
rows[1]
rows[0]
rows.first
rows[2]
Answer explanation
To access the first value in an array named 'rows' in JavaScript, you use 'rows[0]' since array indexing starts at 0.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword should be used to declare variables that should not be reassigned in JavaScript?
A) let
B) var
C) const
D) static
Answer explanation
The keyword 'const' should be used to declare variables that should not be reassigned in JavaScript.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the .log() method do in JavaScript?
A) Adds a value to the end of an array
B) Removes the first element from an array
C) Logs a message to the console
D) Removes the last element from an array
Answer explanation
The .log() method in JavaScript logs a message to the console, making option C the correct choice.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the less than operator (<) allow you to check?
If the value on the left is greater than the value on the right
If the value on the left is equal to the value on the right
If the value on the left is less than the value on the right
If the value on the right is less than the value on the left
Answer explanation
The less than operator (<) allows you to check if the value on the left is less than the value on the right.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the expression count < 3 evaluate to if count is 4?
false
true
undefined
null
Answer explanation
The expression count < 3 will evaluate to false if count is 4 because 4 is not less than 3. Therefore, the correct answer is false.
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
Toán tử trong C ++
Quiz
•
10th - 12th Grade
18 questions
2.3.1. Analysis Design and Comparison of Algorithms
Quiz
•
12th Grade
20 questions
Teknik Pengolahan Audio dan Video
Quiz
•
12th Grade
20 questions
Google Sheet Formulas Functions
Quiz
•
11th - 12th Grade
18 questions
Programming in C language
Quiz
•
12th Grade - University
19 questions
Unity. Lesson 1
Quiz
•
9th - 12th Grade
19 questions
Pokemon
Quiz
•
1st Grade - Professio...
20 questions
Python Recap
Quiz
•
7th Grade - 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
