Table of Contents
ValuesKyle presents examples of different kinds of values. Differences are given between primitive and non-primitive values, and between array indexes and object properties.
OperationsKyle presents examples of different kinds of operations that can be performed, including addition, subtraction and comparison. After explaining what each does, Kyle runs the code to show how they evaluate.
TypesKyle demonstrates how the typeof unary operator can be used to reveal the type of a value, including number, string, boolean, undefined, and object.
VariablesKyle explains what variables are, walking through how to use the assignment operator to assign a variable's value and then how to access the value. Empty values and semicolons are also discussed.
Expressions vs StatementsKyle differentiates between expressions and statements and then counts the number of expressions in an example statement. Kyle later runs an expression and statement to show how they evaluate.
LoopsKyle introduces loops by describing for loops, for of loops, and while loops. After explaining why loops are used, Kyle then runs a while loop to demonstrate how the while loop is working.
FunctionsKyle explains why it is useful to group code together into a function, highlights the parts of a function signature, and shows what a function evaluates to after changing its arguments and running it.
Programming Primer ExerciseKyle instructs students to use the basic programming principles learned in previous lessons to work through an exercise on adding strings to an array, then looping through the array.
Programming Primer SolutionKyle live codes the solution to the exercise.
Programming Primer SummaryKyle summarizes the programming primer section of the course, suggests resources for learning more about mentioned concepts, and discusses what will be covered in the course next.
Types & Coercion
NaNKyle explains what NaN is, when a NaN will be returned, how to test if a value is of the type NaN, and in what situations it is beneficial to test for NaN values.
newKyle differentiates between situations where new should be used to create instances of object representations and when not to use new, and instead by omitting it allow for type conversion to occur.
CoercionKyle introduces coercion by explaining when it occurs, discussing how the plus operator is overloaded related to coercion, and walking through instances of number and string coercion.
Coercion Best PracticesKyle argues for making types and type conversions obvious, and frames the quality of a program related to types in terms of the reader of the code.
EqualityKyle distinguishes between the double and triple equals, and dives into how each works under the hood related to type conversions. A case is made for not always choosing the triple equals.
Types SummaryKyle summarizes the section on types by advocating for critical thinking around how to use types in a program, when to allow type coercion, and when to disallow it.
ScopeKyle introduces scope as the rules for where to look for things and walks through the process of how variables are being looked up in a few lines of code.
Function ExpressionsKyle defines what a function expression is and then performs side-by-side comparisons between named and anonymous function expressions to argue that naming increases readability.
IFFEsKyle discusses when it is beneficial to use the IIFE pattern to create immediately invoked function expressions.
Block Scoping with letKyle explains how to use block scoping as a tool to selectively make variables available, with the let keyword protecting a value from being accessed in an outer scope.
ClosureKyle explains what it means for closure to occur in a program and how to use closure advantageously when passing functions to other functions.
this & Prototypes
Three Pillars of JS ExerciseKyle instructs students to build off of code from the first exercise by incorporating elements of types, scope and closure, and the this and prototypes system.
Three Pillars of JS SolutionKyle live codes the solution to the exercise.