Skip to main content

12 docs tagged with "javascript"

View all tags

Arrays

An explanation of creating, accessing, and manipulating arrays, plus higher-order functions (map / filter / reduce). Covers accessing the end with Array.at(), choosing between includes and indexOf, and the difference between mutating and non-mutating methods.

Asynchronous processing

An explanation, with diagrams, of the path from callbacks to Promises and async/await. Covers choosing between Promise.all / allSettled / any, and the execution order driven by microtasks, in a beginner-friendly way.

Best practices

An explanation of naming conventions, structuring code, error handling, modularization, and debugging techniques. Organizes the basic habits for writing readable, maintainable JavaScript, with practical examples.

Conditionals

An explanation of branching with if statements, the ternary operator, and switch statements. Covers truthy / falsy and the 6 falsy values, short-circuit evaluation of logical operators, and choosing between the nullish coalescing operator ?? and ||, all with practical examples.

Data types

An explanation of JavaScript's 7 primitive types and reference types, and how to use the typeof operator. Covers the historical reason typeof null is object, and the correct way to check for null with === and for arrays with Array.isArray().

DOM manipulation

An explanation of getting, manipulating, and creating HTML elements using the DOM. Covers choosing between textContent and innerHTML and the XSS caveat, plus the difference between an HTMLCollection and a NodeList, in a beginner-friendly way.

Event handling

Covers registering event listeners with addEventListener, the once / passive options, event propagation (capturing and bubbling), and event delegation using closest, organized with practical examples and diagrams.

Functions

An explanation of the difference between function declarations, function expressions, and arrow functions, and how this works. Covers default parameters, the rest syntax, the lexical this of arrow functions, and how to write variadic arguments, with practical examples.

JavaScript Guide

A complete 11-chapter guide that teaches the fundamentals of JavaScript systematically, from variables and data types through functions, arrays, DOM manipulation, and asynchronous processing. Each chapter comes with code examples and beginner-friendly explanations, gradually covering modern syntax (arrow functions, destructuring, async/await, ?. / ??).

Loops

An explanation of how to write and choose between for / while / do-while / for...of / for...in. Covers break and continue, getting the index with entries(), and the reason you shouldn't use for...in on arrays, all in a beginner-friendly way.

Objects

An explanation of object literals, destructuring, the spread syntax, and manipulation methods. Covers shorthand property names and computed property names, and safe access with optional chaining ?., all with practical examples.

Variables and constants

A beginner-friendly explanation of the difference between let / const / var and of scope, hoisting, and the TDZ. Covers how const cannot be reassigned but its contents can change, and how var leaks because it is function-scoped, all with practical examples.