
JavaScript Conditionals Quiz
Quiz
•
Computers
•
12th Grade
•
Medium
Andell Haughton
Used 16+ times
FREE Resource
Enhance your content in a minute
22 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
Which operator is used in JavaScript to check both the value and the type?
==
===
!=
!==
7.
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
Create a free account and access millions of resources
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
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
18 questions
SC025 3-weeks enhancement 1
Quiz
•
12th Grade
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
Ôn tập học kỳ I
Quiz
•
9th - 12th Grade
19 questions
SEMI - Unit 2
Quiz
•
9th - 12th Grade
20 questions
Python Recap
Quiz
•
7th Grade - University
20 questions
uCertity SDA Lesson 2 Quiz
Quiz
•
8th - 12th Grade
17 questions
Cyber Camps 2018 - Review Day 3 Windows
Quiz
•
7th - 12th Grade
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
6 questions
FOREST Self-Discipline
Lesson
•
1st - 5th Grade
7 questions
Veteran's Day
Interactive video
•
3rd Grade
20 questions
Weekly Prefix check #2
Quiz
•
4th - 7th Grade
Discover more resources for Computers
8 questions
Veterans Day Quiz
Quiz
•
12th Grade
28 questions
Ser vs estar
Quiz
•
9th - 12th Grade
19 questions
Explore Triangle Congruence and Proofs
Quiz
•
9th - 12th Grade
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
10 questions
DNA Replication Concepts and Mechanisms
Interactive video
•
7th - 12th Grade
20 questions
Food Chains and Food Webs
Quiz
•
7th - 12th Grade
15 questions
Identify Triangle Congruence Criteria
Quiz
•
9th - 12th Grade
23 questions
Similar Figures
Quiz
•
9th - 12th Grade
