
Understanding If-Else Statements in JavaScript
Authored by Stephanie Ramocan
Computers
6th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
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
15 questions
Word Processing & Advanced Business Documents
Quiz
•
6th - 8th Grade
20 questions
PLTW DM Lesson 1
Quiz
•
6th - 8th Grade
13 questions
Comm Lesson 4 Quiz
Quiz
•
6th Grade
12 questions
Quiz 3 - Networking and the Internet
Quiz
•
4th - 8th Grade
10 questions
QBASIC Programming
Quiz
•
5th - 10th Grade
10 questions
hardware and software(g3)
Quiz
•
2nd - 10th Grade
10 questions
Quick Recap
Quiz
•
6th Grade
10 questions
Anime
Quiz
•
KG - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade