Please enable JavaScript to use CodeHS

{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} {# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} {# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} {# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} {# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} {# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} {# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} {# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} {# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} {# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} {# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #}

Chapter 2

JavaScript Control Structures

{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} 2.1 Booleans Booleans Overview First Boolean Check Your Understanding Exercise: Do You Have a Cat?
{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} 2.2 Logical Operators What Are Logical Operators? The NOT Operator Light Switch The AND Operator The OR Operator Wasting Time Check Your Understanding Exercise: Can You Drive?
{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} 2.3 Comparison Operators Basic Comparisons Grade Range Voting Age Check Your Understanding Exercise: Rolling Dice
{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} 2.4 If Statements Negative Numbers If/Else Statements Even and Odd Secret Password Check Your Understanding Exercise: Ride Height
{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} 2.5 For Loops For Loop Example Variations on the Basic For Loop Countdown Count By Twos For Loop Sum Check Your Understanding Exercise: Chalkboard
{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} 2.6 Random Numbers Randomizer Rolling a Die More Things To Do With The Randomizer Flipping a Coin Check Your Understanding Exercise: Lots of Rolls
{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} 2.7 While Loops While Loop In Action While Loop Countdown While Loops with User Input Beware of Infinite Loops Check Your Understanding Exercise: Inventory
{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} 2.8 Loop and a Half The Infinite Loop The Break Statement The Sentinel Adding Up Numbers Check Your Understanding Exercise: Double Sixes
{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} 2.9 Functions and Parameters Parameters Defining a Function with Parameters Calling a Function with Arguments Double Number Multiple Parameters Sum Function Parameters and Reusable Code Draw Circles Check Your Understanding Exercise: Rectangle
{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} 2.10 Functions and Return Values Keeping Results Calling a Function With a Return Value Double Number Multiple Parameters With a Return Value Return Values Check Your Understanding Exercise: Rectangle with Return Values
{# number the lesson by where it sits in this module: a lesson shared with another module must not link to that other module's number #} 2.11 Local Variables and Scope What Are Local Variables? What is Scope? Why Scope Matters Return Values and Scope Other Scope Examples Check Your Understanding Exercise: Local Variables