Guide
JavaScript / Module 01 JavaScript Fundamentals / Guide
A JavaScript engine is a program that interprets and executes JavaScript code. Every browser has its own engine.
Library Search
Search guides, examples, practice, and runnable labs with ranked results and highlighted snippets.
80 results for JavaScript
JavaScript / Module 01 JavaScript Fundamentals / Guide
A JavaScript engine is a program that interprets and executes JavaScript code. Every browser has its own engine.
JavaScript / Module 01 JavaScript Fundamentals / Guide
Understanding the difference between statements and expressions is fundamental to understanding how JavaScript code works.
JavaScript / Module 24 JavaScript Engine Internals / Guide
All JavaScript Module Systems
JavaScript / Module 24 JavaScript Engine Internals / Guide
Understanding the internal mechanisms that affect JavaScript performance allows you to write faster code. This section covers optimization triggers, deoptimization patterns, and how to work with—not against—the JavaScript engine.
JavaScript / Module 15 Asynchronous JavaScript / Guide
│ EVOLUTION OF ASYNC JAVASCRIPT │
JavaScript / Module 15 Asynchronous JavaScript / Guide
9.2 Promises ## Introduction A Promise is an object representing the eventual completion or failure of an asynchronous operation. Promises provide a cleaner alternative to callbacks for handling async code. ┌────────────────────────────────────────────────────
JavaScript / Module 13 Modern JavaScript / Guide
JavaScript.info: Proxy and Reflect
JavaScript / Module 15 Asynchronous JavaScript / Guide
A callback is a function passed as an argument to another function, to be executed later (after some operation completes). Callbacks are the foundation of asynchronous programming in JavaScript.
JavaScript / Module 15 Asynchronous JavaScript / Guide
JavaScript provides built-in timing functions that allow you to schedule code execution in the future. These functions are essential for creating delays, animations, polling, debouncing, throttling, and other time-based behaviors.
JavaScript / Module 24 JavaScript Engine Internals / Guide
Understanding hidden classes and inline caching is crucial for writing high-performance JavaScript. These V8 optimizations are key to fast property access.
JavaScript / Module 24 JavaScript Engine Internals / Guide
JavaScript automatically manages memory. The garbage collector finds and frees unused objects.
JavaScript / Module 24 JavaScript Engine Internals / Guide
A JavaScript engine is a program that executes JavaScript code. Modern engines are highly sophisticated, using multiple techniques to achieve near-native performance.
JavaScript / Module 15 Asynchronous JavaScript / Guide
9.4 Error Handling in Async Code ## Overview Proper error handling in asynchronous code is crucial for building robust applications. Unlike synchronous code where errors propagate immediately through the call stack, async errors require special handling techni
JavaScript / Module 03 Operators / Guide
Arithmetic operators perform mathematical calculations on numeric values. JavaScript supports all standard mathematical operations plus some additional features like modulo and exponentiation.
JavaScript / Module 05 Functions / Guide
Parameters and arguments are fundamental concepts in JavaScript functions. Parameters are variables listed in the function definition, while arguments are the actual values passed when the function is called. JavaScript provides flexible ways to handle paramet...
JavaScript / Module 13 Modern JavaScript / Guide
Module 13: Modern JavaScript (ES6+)
JavaScript / Module 01 JavaScript Fundamentals / Examples
console.log('JavaScript'.toUpperCase()); // "JAVASCRIPT"
JavaScript / Module 05 Functions / Guide
Note: JavaScript engines don't always optimize tail calls, but the pattern is still useful for clarity.
JavaScript / Module 24 JavaScript Engine Internals / Guide
Master the internal workings of JavaScript engines like V8, SpiderMonkey, and JavaScriptCore. Understanding these internals helps you write more performant code and debug complex issues.
JavaScript / Module 03 Operators / Guide
Assignment operators store values in variables. Beyond the basic =, JavaScript provides compound operators that combine assignment with other operations.
JavaScript / Module 02 Variables And Data Types / Guide
var is the original way to declare variables in JavaScript (pre-ES6). It's still valid but has quirks that make it less predictable.
JavaScript / Module 03 Operators / Guide
// These are ALL the falsy values in JavaScript:
JavaScript / Module 05 Functions / Guide
5.3 Arrow Functions ## Overview Arrow functions, introduced in ES6 (ES2015), provide a more concise syntax for writing function expressions. They also have important differences in how they handle the this keyword, making them ideal for certain use cases like
JavaScript / Module 13 Modern JavaScript / Guide
17.1 Destructuring ## Overview Destructuring is a syntax that allows unpacking values from arrays or properties from objects into distinct variables. It makes code more readable and reduces repetitive property access. ## Array Destructuring ┌──────────────────
JavaScript / Module 03 Operators / Guide
When types differ, JavaScript converts values before comparing:
JavaScript / Module 04 Control Flow / Guide
4.4 While and Do-While Loops ## Overview While loops and do-while loops execute a block of code as long as a condition remains true. Unlike for loops, they don't have built-in initialization or update expressions, making them ideal for situations where the num
JavaScript / Module 01 JavaScript Fundamentals / Practice
* 1.1 Introduction to JavaScript - Exercises
JavaScript / Module 02 Variables And Data Types / Guide
JavaScript has 8 data types, divided into two categories:
JavaScript / Module 02 Variables And Data Types / Guide
Type coercion is JavaScript's automatic (implicit) conversion of values from one type to another. This happens when operators or functions expect a certain type.
JavaScript / Module 05 Functions / Guide
A function expression is an alternative way to define functions in JavaScript. Unlike function declarations, function expressions are not hoisted, and the function is created when the execution reaches that line. Function expressions can be anonymous or named.
JavaScript / Module 05 Functions / Guide
JavaScript provides three methods to explicitly control the this context of a function: call(), apply(), and bind(). These methods allow you to invoke functions with a specific context or create new functions with a permanently bound context.
JavaScript / Module 13 Modern JavaScript / Guide
Master JavaScript's seventh primitive type - unique, immutable identifiers that enable powerful metaprogramming capabilities.
JavaScript / Module 04 Control Flow / Guide
The for loop is the most common looping structure in JavaScript. It executes a block of code a specified number of times, with built-in control over initialization, condition checking, and iteration updates.
JavaScript / Module 04 Control Flow / Guide
Error handling is a critical aspect of robust JavaScript programming. The try...catch statement allows you to handle runtime errors gracefully, preventing your application from crashing and providing meaningful feedback to users.
JavaScript / Module 05 Functions / Guide
Higher-order functions are functions that either take other functions as arguments or return functions as their result. They're a fundamental concept in functional programming and are essential for writing clean, reusable, and expressive JavaScript code.
JavaScript / Module 13 Modern JavaScript / Guide
${...} is normal JavaScript, so keep it small enough to read. If the expression
JavaScript / Module 12 Execution Context / Guide
Hoisting is JavaScript's behavior of moving declarations to the top of their scope during the creation phase. While it might seem magical, it's actually a predictable result of how execution contexts are created.
JavaScript / Module 01 JavaScript Fundamentals / Index
<title>1.1 Introduction to JavaScript</title>
JavaScript / Module 05 Functions / Guide
5.9 Pure Functions and Side Effects ## Overview Pure functions are functions that always produce the same output for the same input and have no side effects. Understanding pure functions is fundamental to functional programming and writing predictable, testabl
JavaScript / Module 13 Modern JavaScript / Guide
17.5 Generators ## Overview Generators are special functions that can pause execution and resume later, yielding multiple values over time. They provide a powerful way to create iterators and handle asynchronous operations. ## Generator Syntax ┌───────────────
JavaScript / Module 05 Functions / Guide
Functions are the fundamental building blocks of JavaScript applications. A function declaration is one of the primary ways to define a reusable block of code that performs a specific task. Function declarations are hoisted, meaning they can be called before t...
JavaScript / Module 05 Functions / Guide
Understanding scope and closures is fundamental to mastering JavaScript. Scope determines where variables are accessible, while closures allow functions to remember and access variables from their parent scope even after the parent has finished executing.
JavaScript / Module 13 Modern JavaScript / Examples
const product = 'JavaScript Book';
JavaScript / Module 18 Browser APIs And Storage / Guide
JSON (JavaScript Object Notation) is a lightweight data interchange format.
JavaScript / Module 13 Modern JavaScript / Guide
17.4 Iterators and Iterables ## Overview Iterators and iterables are protocols that allow objects to define their iteration behavior. They enable the use of for...of loops, spread operator, and other iteration constructs. ## The Protocols ┌────────────────────
JavaScript / Module 04 Control Flow / Guide
JavaScript provides two specialized loop constructs for iterating over data structures:
JavaScript / Module 13 Modern JavaScript / Practice
// const name = 'JavaScript';
JavaScript / Module 03 Operators / Guide
3.7 Spread Operator ## Table of Contents 1. What Is the Spread Operator 2. Spread with Arrays 3. Spread with Objects 4. Spread with Function Calls 5. Spread vs Rest 6. Common Use Cases 7. Performance Considerations --- ## What Is the Spread Operator The spread
JavaScript / Module 24 JavaScript Engine Internals / Practice
* Practice your understanding of JavaScript engine internals.
JavaScript / Module 10 Objects / Guide
JavaScript's Object constructor provides many static methods that operate on objects. These are called on Object itself, not on object instances.
JavaScript / Module 24 JavaScript Engine Internals / Examples
* Practical demonstrations of JavaScript engine concepts
JavaScript / Module 01 JavaScript Fundamentals / Practice
// Rename these variables following JavaScript conventions
JavaScript / Module 04 Control Flow / Guide
JavaScript conditions don't require actual booleans.
JavaScript / Module 15 Asynchronous JavaScript / Practice
* Practice working with JavaScript Promises.
JavaScript / Module 03 Operators / Guide
3.10 Optional Chaining Operator (?.) ## Overview The optional chaining operator (?.) allows you to safely access deeply nested object properties without having to explicitly check if each reference in the chain is valid. If any reference is null or undefined,
JavaScript / Module 03 Operators / Guide
The ternary operator (also called the conditional operator) is JavaScript's only operator that takes three operands. It provides a concise way to write simple conditional expressions.
JavaScript / Module 08 Numbers Math / Guide
BigInt is a built-in JavaScript primitive that provides a way to represent integers larger than the Number.MAX_SAFE_INTEGER (2^53 - 1). Introduced in ES2020, BigInt enables precise arithmetic operations on arbitrarily large integers without losing precision.
JavaScript / Module 10 Objects / Guide
Prototypes are JavaScript's mechanism for inheritance. Every object in JavaScript has a hidden internal property called [[Prototype]] that references another object.
JavaScript / Module 03 Operators / Guide
3.8 Rest Operator ## Table of Contents 1. What Is the Rest Operator 2. Rest in Function Parameters 3. Rest in Array Destructuring 4. Rest in Object Destructuring 5. Rest vs Spread 6. Common Patterns 7. Best Practices --- ## What Is the Rest Operator The rest o
JavaScript / Module 09 Date Time / Guide
9.3 Internationalization (Intl) ## Overview The Intl object is the namespace for the ECMAScript Internationalization API, which provides language-sensitive string comparison, number formatting, date and time formatting, and more. It enables developers to creat
JavaScript / Module 04 Control Flow / Guide
4.2 Switch Statements ## Overview The switch statement evaluates an expression and executes code associated with the matching case. It's often cleaner than multiple if-else if chains when comparing a single value against multiple possibilities. --- ## Table of
JavaScript / Module 10 Objects / Guide
This section covers common design patterns and best practices for working with objects in JavaScript. These patterns solve recurring problems and provide reusable templates for structuring your code.
JavaScript / Module 11 Classes / Guide
You can extend JavaScript's built-in classes.
JavaScript / Module 03 Operators / Guide
// Falsy values in JavaScript
JavaScript / Module 07 Strings / Guide
Regular expressions (regex) are patterns used to match character combinations in strings. JavaScript supports regex through the RegExp object and string methods.
JavaScript / Module 07 Strings / Guide
Strings are sequences of characters used to represent text. JavaScript strings are immutable - once created, they cannot be changed (methods return new strings).
JavaScript / Module 10 Objects / Guide
Objects are collections of key-value pairs where keys are strings (or Symbols) and values can be any type. They're the primary data structure in JavaScript for organizing and storing data.
JavaScript / Module 10 Objects / Guide
Every property in JavaScript has more than just a value. Properties have hidden attributes called descriptors that control their behavior.
JavaScript / Module 11 Classes / Guide
...for creating objects and implementing inheritance. While classes are syntactic sugar over JavaScript's prototype-based inheritance, they offer a more familiar structure for developers coming from other languages.
JavaScript / Module 14 ES Modules / Guide
Before ES6 modules, JavaScript had no built-in module system. Developers created various solutions to organize code into reusable, maintainable pieces. Understanding these systems helps you work with legacy code and appreciate why ES Modules became the standar...
JavaScript / Module 17 DOM Manipulation / Guide
│ JavaScript Access: │
JavaScript / Module 18 Browser APIs And Storage / Guide
│ JavaScript Object localStorage │
JavaScript / Module 03 Operators / Guide
Bitwise operators work on the binary representations of numbers, manipulating individual bits. JavaScript converts numbers to 32-bit signed integers before performing bitwise operations.
JavaScript / Module 06 Arrays / Guide
Deep dive into the most important array methods that are essential for modern JavaScript development.
JavaScript / Module 16 Advanced Async / Guide
AbortController provides a standard way to cancel asynchronous operations in JavaScript. It's essential for managing long-running requests, preventing memory leaks, and improving user experience by allowing users to cancel operations they no longer need.
JavaScript / Module 10 Objects / Guide
10.7 Object.fromEntries and Advanced Object Methods ## Overview This section covers advanced Object static methods including Object.fromEntries(), Object.groupBy(), and other modern object manipulation techniques. These methods provide powerful ways to transfo
JavaScript / Module 17 DOM Manipulation / Guide
│ JavaScript │
JavaScript / Module 01 JavaScript Fundamentals / Examples
/** * ============================================ * 1.2 Basic Syntax - Examples * ============================================ * * This file demonstrates the fundamental syntax concepts * covered in the README. Run in browser console or HTML file. */ // =====
JavaScript / Module 13 Modern JavaScript / Examples
// ============================================ // 17.1 Destructuring - Examples // ============================================ // -------------------------------------------- // 1. Array Destructuring Basics // -------------------------------------------- co
JavaScript / Module 13 Modern JavaScript / Practice
// ============================================ // 17.1 Destructuring - Exercises // ============================================ // Exercise 1: Basic Array Destructuring // Extract the first two elements from the array const fruits = ['apple', 'banana', 'cher