# marijnh/eloquent-javascript

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/marijnh-eloquent-javascript).**

3,097 stars · 806 forks · JavaScript

## Links

- GitHub: https://github.com/marijnh/Eloquent-JavaScript
- Homepage: https://eloquentjavascript.net
- awesome-repositories: https://awesome-repositories.com/repository/marijnh-eloquent-javascript.md

## Description

Eloquent-JavaScript is a comprehensive JavaScript programming textbook and interactive coding tutorial designed for web development education. It serves as both a language reference and a practical guide, combining theoretical lessons with an environment where learners can execute and modify code examples.

The project focuses on the fundamental principles of the JavaScript language, including lexical scoping, prototype-based inheritance, and asynchronous patterns. It provides detailed instruction on object-oriented programming, functional programming, and the use of the browser DOM to create interactive applications.

The material covers a wide range of capabilities, including asynchronous workflow management with promises, HTTP API integration, and client-side state management. It also includes practical applications in 2D game development, such as collision detection, physics simulation, and canvas-based rendering.

Instructional content is delivered across multiple formats, including interactive HTML, static web documents, and exported versions for PDF, EPUB, and MOBI.

## Tags

### Development Tools & Productivity

- [Code Execution Environments](https://awesome-repositories.com/f/development-tools-productivity/code-execution-environments.md) — Provides a built-in environment to execute and test JavaScript code snippets within the textbook. ([source](https://eloquentjavascript.net/code))
- [Text Pattern Search](https://awesome-repositories.com/f/development-tools-productivity/text-pattern-search.md) — Locates the first occurrence of a pattern in a string and returns the start index. ([source](https://eloquentjavascript.net/09_regexp.html))

### Education & Learning Resources

- [JavaScript Learning Curricula](https://awesome-repositories.com/f/education-learning-resources/javascript-learning-curricula.md) — Offers structured educational materials and exercises for mastering JavaScript language features and programming concepts.
- [Interactive Coding Environments](https://awesome-repositories.com/f/education-learning-resources/interactive-coding-environments.md) — Offers an interactive coding environment where learners can modify and run example code in the browser. ([source](https://eloquentjavascript.net/1st_edition))
- [Interactive Coding Tutorials](https://awesome-repositories.com/f/education-learning-resources/interactive-coding-tutorials.md) — Combines theoretical programming concepts with hands-on exercises executable directly within the learning environment.
- [JavaScript Language References](https://awesome-repositories.com/f/education-learning-resources/javascript-language-references.md) — Explores core language internals, including lexical scoping, prototypes, and functional programming patterns.
- [Programming Language Education](https://awesome-repositories.com/f/education-learning-resources/programming-language-education.md) — Serves as a comprehensive resource for learning JavaScript programming principles and syntax. ([source](https://eloquentjavascript.net/1st_edition))
- [Programming Textbooks](https://awesome-repositories.com/f/education-learning-resources/programming-textbooks.md) — Serves as a comprehensive, structured educational book for learning the JavaScript language and software development.
- [Web Development Fundamentals](https://awesome-repositories.com/f/education-learning-resources/web-development-fundamentals.md) — Covers core front-end programming principles for building interactive web applications.
- [Content Localization](https://awesome-repositories.com/f/education-learning-resources/educational-content/content-localization.md) — Translates educational materials into multiple languages to support global accessibility. ([source](https://eloquentjavascript.net/))
- [Multi-Format Courseware](https://awesome-repositories.com/f/education-learning-resources/multi-format-courseware.md) — Provides instructional content across interactive HTML, static web documents, and exported PDF, EPUB, and MOBI versions. ([source](https://eloquentjavascript.net/1st_edition))
- [Recursive Problem Solving](https://awesome-repositories.com/f/education-learning-resources/technical-domain-education/computer-science-education/algorithmic-problem-solving/recursive-problem-solving.md) — Teaches how to solve problems by breaking them into sub-problems using recursive function calls. ([source](https://eloquentjavascript.net/03_functions.html))

### Data & Databases

- [Array Element Modifiers](https://awesome-repositories.com/f/data-databases/array-element-modifiers.md) — Explains how to manipulate arrays by adding or removing elements from the sequence. ([source](https://eloquentjavascript.net/04_data.html))
- [Sequence Management](https://awesome-repositories.com/f/data-databases/typed-data-collections/sequence-management.md) — Teaches the use of arrays to store and manage ordered sequences of values. ([source](https://eloquentjavascript.net/04_data.html))
- [Client-Server State Synchronization](https://awesome-repositories.com/f/data-databases/client-server-state-synchronization.md) — Explains mechanisms for synchronizing local client state with a remote server. ([source](https://eloquentjavascript.net/21_skillsharing.html))
- [Client-Side Data Persistence](https://awesome-repositories.com/f/data-databases/data-management/state-context-management/client-side-data-persistence.md) — Demonstrates how to persist application data in the browser using local storage. ([source](https://eloquentjavascript.net/18_http.html))
- [Data Serialization](https://awesome-repositories.com/f/data-databases/data-processing-pipelines/data-serialization.md) — Covers the serialization and deserialization of complex objects into JSON strings. ([source](https://eloquentjavascript.net/04_data.html))
- [JSON Serializers](https://awesome-repositories.com/f/data-databases/data-processing-pipelines/data-serialization/json-serializers.md) — Covers the conversion of JavaScript objects to JSON strings for storage and network transmission.
- [Data Resource Management](https://awesome-repositories.com/f/data-databases/data-resource-management.md) — Provides practical examples of managing data resources using HTTP methods and JSON CRUD operations. ([source](https://eloquentjavascript.net/21_skillsharing.html))
- [Text Pattern Matching](https://awesome-repositories.com/f/data-databases/text-pattern-matching.md) — Demonstrates how to use captured groups in regular expressions to extract specific substrings from text. ([source](https://eloquentjavascript.net/09_regexp.html))

### Programming Languages & Runtimes

- [Asynchronous Control Flow](https://awesome-repositories.com/f/programming-languages-runtimes/asynchronous-control-flow.md) — Introduces asynchronous workflow management using promises and async/await for readable, linear code. ([source](https://eloquentjavascript.net/11_async.html))
- [Object Prototypes](https://awesome-repositories.com/f/programming-languages-runtimes/class-blueprint-definitions/object-prototypes.md) — Provides a detailed guide to prototype-based inheritance for sharing methods across object instances. ([source](https://eloquentjavascript.net/06_object.html))
- [Class Definitions](https://awesome-repositories.com/f/programming-languages-runtimes/class-definitions.md) — Instructs on building class structures using constructors and class bodies. ([source](https://eloquentjavascript.net/06_object.html))
- [Class Inheritance](https://awesome-repositories.com/f/programming-languages-runtimes/class-inheritance.md) — Teaches how to create new classes that inherit attributes and methods from a superclass. ([source](https://eloquentjavascript.net/06_object.html))
- [Code Commenting](https://awesome-repositories.com/f/programming-languages-runtimes/code-commenting.md) — Explains the use of single-line and block comments for documenting source code. ([source](https://eloquentjavascript.net/02_program_structure.html))
- [Conditional Branching](https://awesome-repositories.com/f/programming-languages-runtimes/conditional-branching.md) — Teaches how to branch execution flow using if, else if, and else statements. ([source](https://eloquentjavascript.net/02_program_structure.html))
- [First-Class Functions](https://awesome-repositories.com/f/programming-languages-runtimes/first-class-functions.md) — Introduces the concept of first-class functions that can be stored in variables and passed as arguments. ([source](https://eloquentjavascript.net/03_functions.html))
- [Default Arguments](https://awesome-repositories.com/f/programming-languages-runtimes/function-argument-passing/default-arguments.md) — Instructs on using default parameters to handle optional arguments in function signatures. ([source](https://eloquentjavascript.net/03_functions.html))
- [Function Definitions](https://awesome-repositories.com/f/programming-languages-runtimes/function-definitions.md) — Introduces the fundamental concept of wrapping logic into reusable functions with arguments. ([source](https://eloquentjavascript.net/02_program_structure.html))
- [Iterative Constructs](https://awesome-repositories.com/f/programming-languages-runtimes/iterative-constructs.md) — Teaches the use of while, do-while, and for loops to repeat tasks. ([source](https://eloquentjavascript.net/02_program_structure.html))
- [Closure Captures](https://awesome-repositories.com/f/programming-languages-runtimes/local-variable-captures/closure-captures.md) — Explains the core language mechanism of capturing lexical environments to create private state via closures. ([source](https://eloquentjavascript.net/03_functions.html))
- [Loop Control Flow](https://awesome-repositories.com/f/programming-languages-runtimes/loop-control-flow.md) — Covers the use of break and continue keywords to control loop iterations. ([source](https://eloquentjavascript.net/02_program_structure.html))
- [Map Data Structures](https://awesome-repositories.com/f/programming-languages-runtimes/map-data-structures.md) — Introduces the use of maps to associate unique keys with specific values. ([source](https://eloquentjavascript.net/06_object.html))
- [Object Management](https://awesome-repositories.com/f/programming-languages-runtimes/object-management.md) — Covers the creation and management of JavaScript objects for data grouping. ([source](https://eloquentjavascript.net/04_data.html))
- [Object Method Binding](https://awesome-repositories.com/f/programming-languages-runtimes/object-method-binding.md) — Provides instruction on associating functions with object instances to implement object-oriented methods. ([source](https://eloquentjavascript.net/06_object.html))
- [Object Property Accessors](https://awesome-repositories.com/f/programming-languages-runtimes/object-property-accessors.md) — Provides fundamental instruction on accessing and modifying object properties using JavaScript syntax. ([source](https://eloquentjavascript.net/04_data.html))
- [Prototype-Based Inheritance](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/programming-languages/language-specific-resources/web-and-scripting-environments/prototype-based-inheritance.md) — Explains the prototype-based inheritance model used to share properties and methods across JavaScript objects.
- [Promise-Based Chains](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-execution-environments/runtime-environments/runtimes/asynchronous-execution-engines/asynchronous-control-flows/promise-based-flow-control/promise-based-chains.md) — Instructs on sequencing asynchronous tasks by linking promise objects to ensure a specific execution order.
- [Variable Bindings](https://awesome-repositories.com/f/programming-languages-runtimes/variable-bindings.md) — Teaches the fundamentals of variable bindings for storing and reusing data. ([source](https://eloquentjavascript.net/02_program_structure.html))
- [Variable Scope Controls](https://awesome-repositories.com/f/programming-languages-runtimes/variable-scope-controls.md) — Explains the management of variable visibility across global, local, and block-level scopes. ([source](https://eloquentjavascript.net/03_functions.html))
- [Private Property Access](https://awesome-repositories.com/f/programming-languages-runtimes/class-member-access/object-member-access/private-property-access.md) — Explains how to use hash prefixes to declare private properties that are hidden from the external interface. ([source](https://eloquentjavascript.net/06_object.html))
- [Static Methods](https://awesome-repositories.com/f/programming-languages-runtimes/class-method-definitions/static-methods.md) — Demonstrates how to define functions on a class constructor for utility methods and alternative object creation. ([source](https://eloquentjavascript.net/06_object.html))
- [Destructuring Assignments](https://awesome-repositories.com/f/programming-languages-runtimes/destructuring-assignments.md) — Instructs on using destructuring syntax to unpack values from arrays or properties from objects into variables. ([source](https://eloquentjavascript.net/04_data.html))
- [Generator Functions](https://awesome-repositories.com/f/programming-languages-runtimes/generator-functions.md) — Teaches how to define generator functions that can be paused and resumed to create lazy sequences. ([source](https://eloquentjavascript.net/11_async.html))
- [Iterable Protocols](https://awesome-repositories.com/f/programming-languages-runtimes/iterable-protocols.md) — Explains how to implement the iterator protocol to make custom objects compatible with for/of loops. ([source](https://eloquentjavascript.net/06_object.html))
- [Argument Spreading](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/language-features/function-invocation-mechanics/argument-spreading.md) — Covers the use of rest parameters and array spreads to handle variable numbers of function arguments. ([source](https://eloquentjavascript.net/04_data.html))
- [Parallel Promise Coordination](https://awesome-repositories.com/f/programming-languages-runtimes/parallel-promise-coordination.md) — Teaches how to coordinate multiple parallel asynchronous tasks using Promise.all and similar patterns. ([source](https://eloquentjavascript.net/11_async.html))
- [Prototype Property Overrides](https://awesome-repositories.com/f/programming-languages-runtimes/prototype-property-overrides.md) — Redefines a property on a specific instance to replace a value inherited from its prototype. ([source](https://eloquentjavascript.net/06_object.html))
- [Regular Expression Construction](https://awesome-repositories.com/f/programming-languages-runtimes/regular-expression-construction.md) — Teaches how to define complex match criteria using regular expressions for precise text searching. ([source](https://eloquentjavascript.net/09_regexp.html))
- [Safe Property Accessors](https://awesome-repositories.com/f/programming-languages-runtimes/safe-property-accessors.md) — Teaches the use of optional chaining and safe access patterns to prevent null or undefined runtime errors. ([source](https://eloquentjavascript.net/04_data.html))
- [Switch Statements](https://awesome-repositories.com/f/programming-languages-runtimes/switch-statements.md) — Teaches the use of switch statements to dispatch logic based on matching values. ([source](https://eloquentjavascript.net/02_program_structure.html))

### Software Engineering & Architecture

- [Asynchronous Workflow Management](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-workflow-management.md) — Teaches the use of promises and async/await to sequence and coordinate asynchronous operations.
- [Non-Blocking Execution](https://awesome-repositories.com/f/software-engineering-architecture/client-server-architecture/long-running-task-protocols/non-blocking-execution.md) — Explains how to run long-running actions in the background to keep the user interface responsive. ([source](https://eloquentjavascript.net/11_async.html))
- [Lexical Scoping](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/layering-presentation/application-layer-architectures/state-management-architectures/scope-and-hierarchy-management/closure-based-state-encapsulations/lexical-scoping.md) — Teaches the fundamental JavaScript concept of using closures to maintain private state within lexical scopes.
- [Interface-Based Polymorphism](https://awesome-repositories.com/f/software-engineering-architecture/interface-based-polymorphism.md) — Teaches how to write polymorphic code that works with any object supporting a specific interface. ([source](https://eloquentjavascript.net/06_object.html))
- [Unique Property Keys](https://awesome-repositories.com/f/software-engineering-architecture/reflection-based-unmarshallers/reflection-based-property-accessors/unique-property-keys.md) — Explains the use of symbol primitives to create unique, non-colliding property keys in objects. ([source](https://eloquentjavascript.net/06_object.html))
- [Immutable State Patterns](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/layering-presentation/application-layer-architectures/state-management-architectures/immutable-data-strategies/immutable-state-patterns.md) — Explains the pattern of creating new data objects for state transitions to ensure predictability.

### User Interface & Experience

- [Event Handlers](https://awesome-repositories.com/f/user-interface-experience/event-handlers.md) — Shows how to register functions as handlers for window and element events. ([source](https://eloquentjavascript.net/15_event.html))
- [Drawing Tools](https://awesome-repositories.com/f/user-interface-experience/drawing-tools.md) — Provides programmatic drawing primitives for manipulating pixel colors, filling rectangles, and drawing lines on a canvas. ([source](https://eloquentjavascript.net/19_paint.html))
- [Form and Input Management](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management.md) — Provides guidance on managing DOM form inputs such as text boxes, checkboxes, and dropdowns. ([source](https://eloquentjavascript.net/18_http.html))

### Web Development

- [Browser DOM Interaction](https://awesome-repositories.com/f/web-development/browser-dom-interaction.md) — Provides detailed instruction on using JavaScript to manage DOM events and handle user input in the browser.
- [Event Listener Management](https://awesome-repositories.com/f/web-development/browser-integration-utilities/dom-event-handling/event-listener-management.md) — Teaches how to programmatically attach and detach event listeners to manage interactive behaviors. ([source](https://eloquentjavascript.net/15_event.html))
- [Event-Driven Architectures](https://awesome-repositories.com/f/web-development/event-driven-architectures.md) — Provides instruction on building interactive applications using an event-driven architecture based on DOM events.
- [HTTP Client Requests](https://awesome-repositories.com/f/web-development/http-client-requests.md) — Instructs on making HTTP requests using various methods and headers to retrieve server data. ([source](https://eloquentjavascript.net/18_http.html))
- [HTTP Request Handlers](https://awesome-repositories.com/f/web-development/backend-development/web-frameworks/routing-request-handling/http-request-handlers.md) — Implements server-side routing that directs HTTP requests to specific handler functions. ([source](https://eloquentjavascript.net/21_skillsharing.html))
- [HTTP API Integrations](https://awesome-repositories.com/f/web-development/http-api-integrations.md) — Teaches how to make HTTP requests and parse JSON responses for interacting with external services.
- [Browser-Side State Management](https://awesome-repositories.com/f/web-development/hydration-state-management/browser-side-state-management.md) — Provides instruction on techniques for managing application state directly within the browser environment.
- [Centralized State Management](https://awesome-repositories.com/f/web-development/hydration-state-management/browser-side-state-management/centralized-state-management.md) — Implements a centralized state management system to synchronize the user interface with application data. ([source](https://eloquentjavascript.net/19_paint.html))
- [Content Translation](https://awesome-repositories.com/f/web-development/internationalization-localization/translation-management-platforms/site-localization/multi-language-content-delivery/locale-based-filters/content-translation.md) — Localizes Markdown text into other languages while maintaining the original structure and licensing. ([source](https://cdn.jsdelivr.net/gh/marijnh/eloquent-javascript@master/README.md))

### Part of an Awesome List

- [Regex Pattern Matching](https://awesome-repositories.com/f/awesome-lists/devtools/regex-and-pattern-matching/regex-pattern-matching.md) — Instructs on using regular expressions to test whether a string contains a specific pattern. ([source](https://eloquentjavascript.net/09_regexp.html))

### Content Management & Publishing

- [Multi-Format Exports](https://awesome-repositories.com/f/content-management-publishing/content-formats-exporting/export-formats/html-exports/multi-format-exports.md) — Generates source material into multiple distinct formats including HTML, PDF, EPUB, and MOBI. ([source](https://eloquentjavascript.net))
- [Digital Book Generation](https://awesome-repositories.com/f/content-management-publishing/digital-book-generation.md) — Converts technical documentation into professional e-book formats like EPUB, PDF, and MOBI. ([source](https://cdn.jsdelivr.net/gh/marijnh/eloquent-javascript@master/README.md))

### DevOps & Infrastructure

- [Response Body Parsing](https://awesome-repositories.com/f/devops-infrastructure/response-parsing-utilities/response-body-parsing.md) — Explains how to extract and convert the body of an HTTP response into plain text or JSON. ([source](https://eloquentjavascript.net/18_http.html))

### Game Development

- [2D Game Development Foundations](https://awesome-repositories.com/f/game-development/2d-game-development-foundations.md) — Provides a complete guide to building interactive 2D games with physics and canvas rendering.
- [Collision Detection Systems](https://awesome-repositories.com/f/game-development/collision-detection-systems.md) — Implements collision detection between game entities and grid tiles for gameplay events. ([source](https://eloquentjavascript.net/16_game.html))
- [DOM-Based Game Rendering](https://awesome-repositories.com/f/game-development/dom-based-game-rendering.md) — Displays a game grid and entities using DOM elements and CSS for educational game development. ([source](https://eloquentjavascript.net/16_game.html))
- [Game Loops](https://awesome-repositories.com/f/game-development/engine-architecture/game-loops.md) — Implements a browser-native game loop using requestAnimationFrame for consistent state updates and rendering.
- [Kinematic Simulations](https://awesome-repositories.com/f/game-development/simulation-engines/entity-simulation-engines/kinematic-simulations.md) — Simulates entity motion using speed, gravity, and time steps with wall collision blocking. ([source](https://eloquentjavascript.net/16_game.html))
- [Tile-Based Level Definition](https://awesome-repositories.com/f/game-development/tile-based-level-definition.md) — Teaches how to parse strings to define 2D game levels, background tiles, and starting positions. ([source](https://eloquentjavascript.net/16_game.html))

### Graphics & Multimedia

- [Canvas Frame Animations](https://awesome-repositories.com/f/graphics-multimedia/image-editing-processing/image-processing/image-sequence-processors/animation-frame-sequencers/canvas-frame-animations.md) — Implements a render loop that clears and redraws a canvas using requestAnimationFrame. ([source](https://eloquentjavascript.net/16_game.html))

### Scientific & Mathematical Computing

- [Geometric Transformation Routines](https://awesome-repositories.com/f/scientific-mathematical-computing/linear-algebra-routines/geometric-transformation-routines.md) — Demonstrates how to modify the coordinate system using scaling, rotation, and translation. ([source](https://eloquentjavascript.net/17_canvas.html))
