
JavaScript Conditionals Quiz
Authored by Andell Haughton
Computers
12th Grade
Used 30+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
32 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax for an if statement in JavaScript?
if (x > 0) { }
if x > 0: { }
if x > 0 then { }
if (x > 0) then { }
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which logical operator is used in JavaScript to represent "AND"?
&&
||
!
==
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output? ```javascript if (false || true) { console.log("True"); } else { console.log("False"); } ```
True
False
Error
Nothing
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you write an if statement in JavaScript to execute some code if "x" is either greater than 10 or less than or equal to 20?
if (x > 10 || x <= 20)
if (x > 10 && x <= 20)
if x > 10 or x <= 20
if x > 10 and x <= 20
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet? ```javascript let x = 5; if (x > 3) { if (x < 10) { console.log("Yes"); } } else { console.log("No"); } ```
Yes
No
Error
Nothing
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following JavaScript code output? ```javascript let age = 18; if (age > 18) { console.log("Adult"); } else if (age == 18) { console.log("Just an adult"); } else { console.log("Not an adult"); } ```
Adult
Just an adult
Not an adult
Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In JavaScript, which logical operator represents the "OR" condition?
&&
||
!
==
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
30 questions
Computer Science Revision Quiz
Quiz
•
9th - 12th Grade
30 questions
Lógica de Programaçao
Quiz
•
1st - 12th Grade
36 questions
sql basics vaishali
Quiz
•
11th - 12th Grade
28 questions
MAWD 1.01 B
Quiz
•
KG - University
27 questions
Quiz sobre Desenho de Sítios Web
Quiz
•
12th Grade
30 questions
ANALISIS DATA PEMROGRAMAN
Quiz
•
9th - 12th Grade
35 questions
Excel 2016 Introduction
Quiz
•
10th - 12th Grade
34 questions
TIN 9 ÔN TẬP GIỮA KỲ 2
Quiz
•
8th Grade - University
Popular Resources on Wayground
8 questions
2 Step Word Problems
Quiz
•
KG - University
20 questions
Comparing Fractions
Quiz
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Latin Bases claus(clois,clos, clud, clus) and ped
Quiz
•
6th - 8th Grade
22 questions
fractions
Quiz
•
3rd Grade
7 questions
The Story of Books
Quiz
•
6th - 8th Grade
Discover more resources for Computers
8 questions
2 Step Word Problems
Quiz
•
KG - University
10 questions
Martin Luther King, Jr. For Kids
Interactive video
•
1st - 12th Grade
10 questions
Dr. King's Speech and Its Impact
Interactive video
•
7th - 12th Grade
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
7 questions
Anti-Bullying ARS 15-341
Quiz
•
9th - 12th Grade
13 questions
Model Exponential Growth and Decay Scenarios
Quiz
•
9th - 12th Grade
15 questions
TSI Math Practice Questions
Quiz
•
8th - 12th Grade
24 questions
Identify Properties of Polygons and Quadrilaterals
Quiz
•
9th - 12th Grade