JavaScript Conditionals and Loops

Objectives

  • Understand the benefits of altering control flow in JavaScript
  • Use boolean statements to return true and false values
  • Utilize if/else statements in order to skip blocks of code
  • Utilize for, for...in, and while loops to loop through data structures and repeat code
  • Identify truthy and falsey values

Control Flow

A program can be read from top to bottom, but eventually we'll need ways to skip over code or repeat code. In other words, we need to alter the control flow of the program. Here are some of the statements we'll be using.

  1. if
  2. switch
  3. while
  4. for
  5. for...in

But before that, let's create the expressions needed for these statements.

Notes: We'll be introducing the debugging properties of the chrome console today:


https://github.com/wdi-sg/google-shopping-conditionals-loops

https://github.com/wdi-sg/js-functions

results matching ""

    No results matching ""