Skip to content

Lesson 2 (Conditionals & Debugging)

Courtney Frey edited this page Apr 13, 2022 · 3 revisions

Lesson 2: Conditionals and Debugging

In the prep work for this lesson, the students learned:

  1. The boolean data type and boolean expressions
  2. Logical operators (>, <, etc.) and == vs. ===
  3. Logical AND, OR, and NOT
  4. if / else if / else statements
  5. Three common error types (syntax, runtime, logic)
  6. How to use console.log to help debug code

Large Group Time (Instructor Notes)

Announcements

For Part-Time Students

  1. Note the due date for the first graded assignment (should be 2 - 4 weeks away).
    1. Assignment 1 has been broken into 3 parts. Check Canvas for the due dates for each part.
  2. The assignment will be active in Canvas soon, and the students will know enough after lesson 2 to begin the first part of the assignment.

For Full-Time Students

  • Welcome to Day 2

Lesson 2 Topics That Require More Attention

  1. Q & A from the prep work and/or exercises.
    1. Recommend walking through the debugging exercises to reinforce how to spot the different error types, how to use error messages to find bugs, and how to systematically find and fix logic errors.
  2. Emphasize why === should be used instead of ==.
  3. Review the meaning of the truth tables for logical AND and logical OR.
  4. Clarify with live coding examples:
    1. The difference between an if / else if block and two successive if blocks
    2. Nested conditionals
    3. Check multiple conditions with && and ||
    4. When would we use !?
  5. The studio is a non-coding activity.
    1. Refer to the TF Notes and prepare a brief intro about why this activity will benefit the students.

Studio (TF Notes)

  1. Even though this is a non-coding studio, it requires more preparation and thought than usual.
  2. The studio helps the students build confidence and identify what they want to get out of this class, so it is critical that you play your part well.
  3. Refer to the notes you received from LaunchCode as you prepare for and run the studio. You can also access the notes here.