
Understanding JavaScript Conditionals
Quiz
•
Computers
•
10th Grade
•
Medium
Radeyyah Hossain
Used 2+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the boolean value of the expression `5 > 3` in JavaScript?
`true`
`false`
`undefined`
`null`
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is the correct syntax for an if statement in JavaScript?
`if x > 5 then { console.log(x); }`
`if (x > 5) { console.log(x); }`
`if x > 5: { console.log(x); }`
`if (x > 5) then { console.log(x); }`
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following code snippet? ```javascript let isRaining = false; if (isRaining) { console.log("Take an umbrella."); } else { console.log("No need for an umbrella."); } ```
`Take an umbrella.`
`No need for an umbrella.`
`undefined`
`isRaining`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a boolean data type in JavaScript?
`0`
Yes
`true`
`1`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following code: ```javascript let temperature = 30; if (temperature > 25) { console.log("It's hot outside."); } else { console.log("It's not that hot."); } ``` What will be printed to the console?
`It's hot outside.`
`It's not that hot.`
`undefined`
`null`
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of an else statement in JavaScript?
To execute code when the if condition is true
To execute code when the if condition is false
To declare a variable
To create a loop
7.
MULTIPLE CHOICE QUESTION
30 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 }
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Greater than or equal to
> or =
> || =
>=
<=
Similar Resources on Wayground
10 questions
Introduccion a HTML,CSS y PHP
Quiz
•
10th Grade
12 questions
Ms. Excel Rev
Quiz
•
8th - 11th Grade
10 questions
pretest css
Quiz
•
10th Grade
10 questions
Pre Test - Unit 1 [Website Creation]
Quiz
•
10th Grade
12 questions
J808 LO4.4 Preventative Measures (Logical)
Quiz
•
10th - 11th Grade
10 questions
TIN HỌC 10 - BÀI 21
Quiz
•
10th Grade
10 questions
AIJ Test 1 Firewall Jaringan
Quiz
•
9th - 12th Grade
12 questions
GCSE AQA 04 Computer Systems - Languages & Translators
Quiz
•
10th - 11th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade