Table of Contents
Understanding Your CodeKyle describes how incorrect assumptions about how code is working causes bugs.
typeof OperatorKyle discusses the behavior of the typeof operator and focuses on cases that typically cause confusion.
NaN & isNaNKyle discusses what a NaN, how to use isNaN, and common sources of error in the usage of both.
Type Check ExerciseStudents are instructed to define a new function that implements what was learned in the previous section.
Type Check Exercise SolutionKyle live codes the solution to the exercise.
toStringKyle discusses the behavior of the abstract operation toString.
toNumberKyle discusses the behavior of the abstract operation toNumber.
toBooleanKyle discusses the behavior of the abstract operation toBoolean.
Cases of CoercionKyle walks through typical situations where number to string, string to number, and any type to boolean coercions occur.
BoxingKyle introduces boxing and gives an example.
Corner Cases of CoercionKyle makes a case for learning situations where coercion causes unexpected results.
Philosophy of Coercion
Intentional CoercionKyle explains how to use coercion successfully by having a coding style that makes types obvious.
Culture of LearningKyle advocates for a culture where less experienced developers are encouraged to learn correct practices.
Code Communication Q&AKyle discusses code comments and the role of notation standards like JSDoc in code communication.
Implicit CoercionKyle advocates for code that is clear in its usage of types, which allows for the use of implicit coercion.
Coercion ExerciseStudents are instructed to define two validation functions.
Coercion Exercise SolutionKyle live codes the solution to the exercise.
Double & Triple EqualsKyle compares the behavior of double equals and triple equals, which are often mistakenly defined.
Coercive EqualityKyle discusses the choice to use double equals or triple equals and how linters can both help and hurt code.
Double Equals AlgorithmKyle analyzes the spec on coercive equality to understand completely each step of the double equals comparison.
Double Equals WalkthroughKyle walks through a few lines of code that utilize the double equals for coercive equality.
Double Equals SummaryKyle gives a summary of what double equals does when it is used in a program.
Double Equals Corner CasesKyle uses a code example to make the argument that famous corner cases are often pulled from situations unlikely to occur.
Corner Cases: BooleansKyle demonstrates what happens when an empty array is coerced into a boolean in multiple situations.
Corner Cases: SummaryKyle offers advice on using double equals for coercive equality comparisons.
The Case for Double EqualsKyle makes the case that double equals is preferable to triple equals, which can be used as a sign that types are unknown.
Equality ExerciseKyle introduces the exercise on equality, which is to handle corner cases in equality comparison.
Equality Exercise SolutionKyle codes the solution to the exercise.
TypeScript & FlowKyle discusses the benefits and drawbacks of using tools like TypeScript and Flow for type checking.
InferencingKyle defines what inferencing is in static typing.
Custom TypesKyle defines what custom types are and explains how they can help to reduce type misassignments.
Validating Operand TypesKyle makes the assertion that the validation of operand types is a useful aspect of static typing.
TypeScript & Flow SummaryAfter mentioning an article on TypeScript compared with Flow, Kyle summarizes his thoughts on these two tools.
Static Typing ProsKyle discusses benefits of static typing.
Static Typing ConsKyle discusses the drawbacks of static typing.
ScopeKyle introduces the section of the course on scope.
Compilation & ScopeKyle walks through compilation of code using a silly exercise to illustrate a mental model for scope.
Executing CodeKyle walks through execution of code using the exercise from the previous lesson.
Compilation and Scope Q&AKyle answers questions about the stages of compilation and execution.
Code Execution: Finishing UpKyle finishes walking through the execution of code, differentiating between two types of lookups.
Lexical Scope ReviewThe lexical scope stage of the two stage mental model is reviewed.
Compilation ReviewThe compilation stage of the two stage mental model is reviewed.
Dynamic Global VariablesKyle demonstrates what dynamic global variables are and in what situations they are created.
Strict ModeKyle gives various arguments for the usage of strict mode.
Nested ScopeKyle walks through an example of nested scope.
Undefined vs UndeclaredKyle reviews the difference between a variable that is undefined versus one that is undeclared.
Lexical Scope ElevatorKyle introduces a metaphor for lexical scope.
Scope & Function Expressions
Function ExpressionsKyle defines and analyzes function expressions in relation to scope.
Naming Function ExpressionsKyle gives three reasons why named function expressions are superior to anonymous function expressions.
Arrow FunctionsKyle breaks down the reasons why people use arrow functions and brings to light a few of their drawbacks.
Function Types HierarchyKyle presents a hierarchy of function types and explains each level based on information from previous lessons.
Function Expression ExerciseStudents are instructed to write a set of comparable functions and function expressions.
Function Expression Solution: FunctionsKyle live codes the first part of the solution using function declarations.
Function Expression Solution: Arrow FunctionsKyle live codes the second part of the solution using arrow functions.
Lexical & Dynamic ScopeKyle contrasts the models of lexical scoping versus dynamic scoping and gives examples of each.
Lexical ScopeKyle breaks down ways to thinking about lexical scope using the bucket model from previous lessons, a new technique, and a type highlighting tool.
Dynamic ScopeKyle demonstrates how dynamic scope works using a theoretical code example.
Function ScopingKyle presents arguments in support of the core principle of strategically hiding information in levels of scope.
IIFE PatternKyle introduces the benefits of using the IIFE pattern.
Block ScopingKyle differentiates between situations where it is and is not useful to create block scoping.
Choosing let or varKyle analyzes the choice of whether to choose let or var in the contexts of performance and code communication.
Explicit let BlockKyle presents a use case for an explicit let block.
constKyle illustrates the potential semantic issues of using const.
const Q&AKyle identifies situations where const can be useful.
HoistingKyle debunks myths surrounding the concept of hoisting and clarifies what is actually happening under the hood.
Hoisting ExampleKyle walks through code examples that utilize hoisting with functions and variables.
let Doesn't HoistKyle uses a code example to disprove the common saying "let doesn't hoist".
Hoisting ExerciseStudents are instructed to refactor existing code to take advantage of hoisting.
Hoisting Exercise SolutionKyle live codes the solution to the exercise.
What is Closure?Kyle defines what it means to close over variables and indicates where in a function it is occuring.
Closing Over VariablesKyle distinguishes between what it means to close over a variable instead of a value through code examples.
Module PatternKyle introduces the module pattern by explaining how data encapsulation involves closure.
ES6 Modules & Node.jsKyle discusses incompatibility issues with the ES6 module system and Node.js.
ES6 Module SyntaxKyle outlines the two styles of importing ES6 modules.
Module ExerciseStudents are instructed to refactor existing code to use the module pattern.
Module Exercise SolutionKyle live codes the solution to the exercise.
Objects OverviewKyle introduces the section of the course on objects.
Implicit & Explicit BindingKyle differentiates implicit binding from explicit binding by giving several examples of each.
The new KeywordKyle highlights the four-part result of invoking a function with the new keyword.
Default BindingKyle explores the results of invoking a function with the default binding in non-strict mode and strict mode.
Binding PrecedenceKyle uses a code example to delve into the order of operations of which binding rule takes precedence.
Arrow Functions & Lexical thisKyle analyzes how the this keyword behaves in arrow functions.
Resolving this in Arrow FunctionsKyle clarifies misconceptions about how the this keyword is resolved within arrow functions.
this ExerciseStudents are instructed to refactor existing code to use the namespace pattern.
this Exercise SolutionKyle live codes the solution to the exercise.
ES6 class KeywordKyle explains what a class is and outlines a few of its capabilities.
Fixing this in ClassesKyle walks through a temporary fix method for this keyword behavior in the context of classes.
class ExerciseStudents are instructed to refactor existing code to use the class pattern.
class Exercise SolutionKyle live codes the solution to the exercise.
PrototypesKyle introduces the section of the course on prototypes by discussing mental models.
Prototypal ClassKyle presents a code example of a class system written using prototype to highlight data relationships.
Dunder PrototypesKyle defines dunder prototypes and gives their use cases.
this & prototypes Q&AKyle discusses binding, arrow function scope, setting dunder proto, and super.
Shadowing PrototypesKyle walks through an example of shadowing within the prototypes system.
Prototypal InheritanceKyle explains how to link prototypes to each other to take advantage of inheritance.
Classical vs Prototypal InheritanceKyle clarifies the difference between classical and prototypal inheritance in terms of copying or linking relationships.
OLOO PatternKyle demonstrates how to implement a new design pattern involving linked objects.
Delegation-Oriented DesignKyle argues for code designed with linked objects in mind.