
Understanding If-Else Statements in JavaScript
Quiz
•
Computers
•
6th Grade
•
Practice Problem
•
Hard
Stephanie Ramocan
Used 1+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main use of booleans in JavaScript as mentioned in the text?
To declare variables
To create loops
To define functions
As a condition of an if statement
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does an if statement do with the code inside its curly braces if the condition is true?
Deletes the code
Executes the code
Repeats the code
Ignores the code
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What can be used as a condition in an if statement?
An array
A string
A number
A boolean variable
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens if the condition in an if statement is false?
The code inside is deleted
The code inside is ignored forever
The code inside is executed twice
The code inside is not executed
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What keyword is used to add code that executes when the if statement condition is false?
else
then
while
elseif
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you write an if-else statement to handle both true and false conditions?
Use 'else' for both true and false
Use 'elseif' for false
Use 'if' for both true and false
Use 'if' for true and 'else' for false
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the 'else' part of an if-else statement do?
Never executes
Executes all the time
Executes only when the condition is true
Executes only when the condition is false
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
13 questions
Five Nights At Freddy's: Security Breach Quiz
Quiz
•
KG - Professional Dev...
12 questions
Creating Webpages
Quiz
•
6th - 8th Grade
10 questions
Formatting a Spreadsheet
Quiz
•
6th Grade
20 questions
Web 2.0
Quiz
•
6th - 10th Grade
15 questions
Layers, IP, MAC Addressing and Packets
Quiz
•
2nd - 9th Grade
10 questions
Microsoft Word Screen Elements
Quiz
•
6th - 7th Grade
12 questions
Spreadsheet
Quiz
•
5th - 11th Grade
15 questions
KS3 Y8 Kodu Quiz
Quiz
•
5th - 8th Grade
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd 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
