Foundations: How JavaScript Runs

What actually happens between saving a file and seeing output: which engine reads your code, which host hands it superpowers, how one thread schedules everything, and how to read the first error you cause instead of guessing at it.

What you will be able to do

  • Separate the language itself from the host environment it runs inside
  • Run code in a browser, in Node and in a module, and know which is which
  • Use the console family beyond console.log, including table, time and group
  • Name variables the way the ecosystem does, and say what use strict changes
  • Read an error name, message and stack trace and go straight to the guilty line

Lessons

  1. What JavaScript Is — JavaScript is a single-threaded language that runs inside a host, and the host gives it superpowers. (8 min)
  2. Running Your First Code — A statement does something; an expression produces a value. The console is how you watch both. (10 min)
  3. Syntax, Style and Strict Mode — Names are documentation, and strict mode turns silent mistakes into loud ones. (9 min)
  4. How to Read an Error — An error is a message with an address: the name says what kind, the stack says where. (10 min)