Skip to content

Javascript Fundamentals Textbook

A free, self-paced textbook in 8 chapters. Read a chapter, then drill it with the 100 companion flashcards using spaced repetition.

8 chapters · 100 cards · Updated

Chapters

  1. 1JavaScript Foundations

    JavaScript is a high-level, interpreted programming language that runs in every modern browser and is the scripting language of the Web. It was created by Brendan Eich in 1995 whil...

  2. 2Variables, Types, and Operators

    JavaScript offers three keywords for declaring variables: var, which is function-scoped, and let and const, both of which are block-scoped and were introduced in ES6. const declare...

  3. 3Control Flow and Functions

    Programs make decisions with if, else if, and else blocks. The condition in an if statement is evaluated for truthiness, and JavaScript will coerce any non-boolean value into a boo...

  4. 4Data Structures and ES6 Syntax

    JavaScript's two main collection types are arrays and objects. Arrays are created with square brackets, for example const arr = [1, 'a', true]; or with the new Array() constructor,...

  5. 5Scope, Hoisting, and Closures

    Scope is the region of code where a variable is accessible. The outermost region is the global scope, available everywhere in a script. Variables declared with var are function-sco...

  6. 6Objects, Classes, and Built-in APIs

    Even though ES6 introduced the class keyword, JavaScript's object system is built on prototypes. The prototype chain is how JavaScript looks up a property: if it is not found on an...

  7. 7Asynchronous JavaScript

    Long-running operations like network requests must run asynchronously so the browser stays responsive. JavaScript represents these operations with Promises, which are objects that...

  8. 8Browser Interaction and Best Practices

    JavaScript's classic role is to manipulate the Document Object Model (DOM). You can select a single element with document.getElementById('id') or document.querySelector('.class'),...

← Back to the Javascript Fundamentals deck