Decisions with If/Else Statements
Learning Objective
I can write code using "if/else" statements to make decisions in JavaScript.
Lesson Flow
Watch Video
Learn JavaScript Episode #7: If/Else Statements
Joseph Delgadillo
Guided Notes
Key concepts students will learn:
- •
An `if` statement in JavaScript starts with the keyword if, followed by a comparison in parentheses, and code to execute in curly brackets.
- •
If the condition in an `if` statement is not true, an else statement can be used to execute alternative code.
- •
The `else if` statement lets you check multiple conditions in a sequence, executing the code block for the first condition that evaluates to true.
Practice
10 questions • Multiple choice & Short answer
Exit Ticket
“Write a JavaScript code snippet that checks if a variable called 'score' is greater than or equal to 70. If it is, print "You passed!". Otherwise, print "Try again.".”
Teacher Guide
Get the complete package:
- Answer keys for all questions
- Differentiation strategies
- Extension activities
- Printable student handouts
