Please enable JavaScript to use CodeHS

North Carolina Intro to Computer Science (2020)

Lesson 1.11 If Statements

Description

In this lesson, students will learn about conditions and if statements. A condition is a function that returns a true/false answer. JavaScript uses if statements as a way to make decisions and execute specific code. If statements are helpful in writing code that can be used in different situations.


Objective

Students will be able to:

  • Use conditions to gather information about Karel’s world (is the front clear, is Karel facing north, etc)
  • Create if statements to only execute code if a certain condition is true