JavaScript

The event loop, closures, this and the rest of the runtime rules.

The course

Open the course

Start at 01. The first lesson names the types. The next one builds an object. Each sample is on the page.

  1. Skill

    Basics

    The types, explained, then an object you can name and call.

    1. 01 JavaScript from zero: a value has a type Start here

      typeof reports the type of a value. A latte label uses a number, a string, and a boolean. The program prints latte $4.50 ready, then number string boolean.

      Adds The types this course uses

      2 min read

    2. 02 JavaScript from zero: an object has fields

      An object groups named fields. A latte has a name and a price in cents. The program prints latte $4.50.

      Adds An object you can name and call

      Builds on 12 min read

  2. Practice

    Tips

    A rule that prevents a bug, then a program that uses the object.

    1. 03 JavaScript from zero: a class holds the method

      A class puts the fields and the method on one object. new Item makes a latte. label prints latte $4.50.

      Adds A tip that prevents a bug

      Builds on 1 through 22 min read

    2. 04 JavaScript from zero: const does not freeze the fields

      const stops a new assignment to the name. It does not freeze the fields. A spread copies the drink. The original stays 450. The tipped copy is 540.

      Adds A program that uses the object

      Builds on 1 through 32 min read

  3. Further

    A whole program

    One more idea, then a program that puts the pieces together.

    1. 05 JavaScript from zero: a method needs its object

      Pulling a method off the object and calling it loses this. The detached call throws. Calling label on the latte prints latte $4.50.

      Adds A program that puts the pieces together

      Builds on 1 through 42 min read

    2. 06 JavaScript from zero: pass the object

      A function can take the object and read the fields it needs. price takes a drink and returns the label. The program prints latte $4.50.

      Adds A program that puts the pieces together

      Builds on 1 through 52 min read

GoByte Skills: JavaScript track, 3 lessons. The event loop, closures and this: the runtime rules behind JavaScript's surprises.

Open the JavaScript track

Articles

RSS