
JavaScript Conditional Statements Quiz
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Medium
Lara Luca
Used 5+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output? ```javascript if (5 > 3) { console.log("Yes"); } else { console.log("No"); } ```
Yes
No
Undefined
Error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the code snippet below. What will be the output? ```javascript let age = 18; if (age > 18) { console.log("Adult"); } else if (age == 18) { console.log("Just turned adult"); } else { console.log("Not an adult"); } ```
Adult
Just turned adult
Not an adult
Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the following code print? ```javascript let x = 10; if (x > 5) { if (x < 15) { console.log("Yes"); } } else { console.log("No"); } ```
Yes
No
Undefined
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about the `else` statement in JavaScript?
It executes a block of code if the condition in the `if` statement is true.
It can appear without an `if` statement.
It executes a block of code if the condition in the `if` statement is false.
It can only be used once in an `if-else` chain.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times can `else if` statements be used in an `if-else` chain?
Only once
Up to 3 times
As many times as needed
Not at all
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code snippet output? ```javascript let score = 75; if (score >= 90) { console.log("A"); } else if (score >= 80) { console.log("B"); } else if (score >= 70) { console.log("C"); } else { console.log("F"); } ```
A
B
C
F
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? ```javascript let num = 20; if (num > 15) { console.log("Greater"); } else if (num == 20) { console.log("Equal"); } else { console.log("Lesser"); } ```
Greater
Equal
Lesser
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
Already have an account?
Similar Resources on Wayground
15 questions
Digital Etiquette
Quiz
•
4th Grade - University
10 questions
Topologies and Architecture
Quiz
•
9th - 12th Grade
15 questions
KKHP Roblox Game Development Quiz
Quiz
•
4th - 12th Grade
17 questions
Week #7 - Time Machine
Quiz
•
8th Grade - University
20 questions
Tryout TIK level 6.1
Quiz
•
6th Grade - University
10 questions
Tarkie Seminar for Disers
Quiz
•
9th - 12th Grade
20 questions
Fungsi IF, AND dan OR
Quiz
•
10th - 12th Grade
10 questions
Latihan Soal Monitoring
Quiz
•
12th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
15 questions
Christmas Song Emoji Pictionary
Quiz
•
7th - 12th Grade
20 questions
Christmas Movies
Quiz
•
1st - 12th Grade
55 questions
CHS Holiday Trivia
Quiz
•
12th Grade
20 questions
Christmas Movie Trivia
Quiz
•
9th - 12th Grade
29 questions
christmas facts
Lesson
•
5th - 12th Grade
20 questions
Christmas Trivia
Quiz
•
5th - 12th Grade
20 questions
Stages of Meiosis
Quiz
•
9th - 12th Grade
