Getting Started with JavaScript, v2

Kyle Simpson

Kyle Simpson

You Don't Know JS
2 hours, 36 minutes CC
Getting Started with JavaScript, v2

Course Description

Want to learn to code using JavaScript? This is a great place to start! In this course, you’ll start out with a tour of the basic building blocks programming like variables, loops, functions and operations. Then, you’ll go through the three main pillars of JavaScript: Types and Coercion for comparing values and converting between types, Scope and Closure for knowing where variables can be accessed, and JavaScript’s “this” and Prototype system for dynamic context.

This course and others like it are available as part of our Frontend Masters video subscription.

Preview
Close

Course Details

Published: June 20, 2019

Learning Paths

Learn Straight from the Experts Who Shape the Modern Web

Your Path to Senior Developer and Beyond
  • 200+ In-depth courses
  • 18 Learning Paths
  • Industry Leading Experts
  • Live Interactive Workshops
Get Unlimited Access Now

Table of Contents

Introduction

Section Duration: 9 minutes

Programming Primer

Section Duration: 1 hour, 2 minutes

Types & Coercion

Section Duration: 33 minutes
  • Primitive Types
    Kyle introduces primitive types by debunking the myth that everything in JavaScript is an object and then explains what it means for the type to belong to the value in JavaScript instead of the variable.
  • NaN
    Kyle 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.
  • new
    Kyle 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.
  • Coercion
    Kyle 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.
  • Booleans
    Kyle displays the list of falsy and truthy values in JavaScript, and explains how the falsy list can be used to know which values will become true or false during conversion to a boolean value. Examples are given in the form of if and while statements.
  • Coercion Best Practices
    Kyle 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.
  • Equality
    Kyle 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 Summary
    Kyle 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.

Scope

Section Duration: 20 minutes

this & Prototypes

Section Duration: 11 minutes
  • this
    Kyle demonstrates how the this keyword in JavaScript's dynamic context system references the execution context of a function call in order to access values that are specific to that function call.
  • Prototypes
    Kyle introduces prototypal inheritance in JavaScript through an example where a method is added to a constructor's prototype and is then available to instances created using the constructor.
  • class
    Kyle explains how the class keyword works in JavaScript by displaying code using the class syntax that achieves the same result as code that uses the prototypal inheritance pattern.

Practice

Section Duration: 16 minutes

Wrapping Up

Section Duration: 1 minute

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now