What you will learn in Secrets of the JavaScript Ninja, Third Edition
Chapter by chapter
Chapter 1: JavaScript is everywhere
The introduction explains how JavaScript evolved from a browser scripting language into a versatile language with better performance and development tools.
What you learn in chapter 1 →Chapter 2: Using modern JavaScript tools
The chapter introduction explains how modern tools added guardrails to JavaScript development and why Node.js is used to run those tools.
What you learn in chapter 2 →Chapter 3: Working with Node.js and npm
The introduction explains why JavaScript suited Node.js’s original server goal and why Node.js and npm matter beyond server applications.
What you learn in chapter 3 →Chapter 4: Building web applications
The introduction explains how JavaScript became central to web development and why developers still need to understand browser behavior.
What you learn in chapter 4 →Chapter 5: First-class functions for the novice: definitions and arguments
The chapter introduction explains why functions are central to JavaScript and introduces their status as first-class objects.
What you learn in chapter 5 →Chapter 6: Functions for the journeyman: understanding function invocation
This chapter introduction establishes that `this` depends on how a function is called and explains why rest parameters have largely replaced the older `arguments` object.
What you learn in chapter 6 →Chapter 7: Functions for the master: closures and scopes
The chapter introduction explains why closures matter and connects them to JavaScript scope without yet explaining their mechanics.
What you learn in chapter 7 →Chapter 8: Functions for the future: promises and generators
The chapter introduces promises as a modern alternative to callbacks for dealing with future events and previews async/await and generators.
What you learn in chapter 8 →Chapter 9: Objects, prototypes, and classes
The introduction explains why JavaScript objects are more than key-value pairs and why prototypes still matter in an era of classes.
What you learn in chapter 9 →Chapter 10: Dealing with collections
The chapter introduces JavaScript collections by distinguishing arrays, maps, and sets, then previews a discussion of immutability.
What you learn in chapter 10 →Chapter 11: Buffers and streams
The chapter introduction explains why buffers and streams help JavaScript handle large data efficiently and notes that these APIs are available across modern runtimes.
What you learn in chapter 11 →Chapter 12: Wrangling regular expressions
The chapter introduction explains why regular expressions are useful for searching and parsing strings, while cautioning that some patterns call for a full parser instead.
What you learn in chapter 12 →Chapter 13: Modules and bundlers
This introduction traces why JavaScript module formats emerged, how developers worked around their limitations, and why ESM is becoming the standard.
What you learn in chapter 13 →Concepts explained in this book
- regular expressionA pattern notation used to match and manipulate text.
- JavaScriptJavaScript is a high-level programming language standardized as ECMAScript and widely used for web and general-purpose software development.
- promiseThe ECMAScript constructor and associated object abstraction for representing the eventual completion or failure of an asynchronous operation.
- arrayAn array is an ordered JavaScript collection whose elements are accessed by numeric indexes.
- regex groupingA capturing group is a parenthesized regular-expression subpattern whose matched text is stored for later extraction or reference.
- scopeScope determines where bindings are visible and how names are resolved.
- bufferingThe temporary storage of produced data before it is consumed.
- TypeScriptA statically typed superset of JavaScript that compiles to JavaScript.
- Array.prototype.sortA JavaScript method that sorts an array in place using a default ordering or a supplied comparison function.
- comparison functionA compare function is a sorting callback that returns a negative, positive, or zero number to order two items.
- ECMAScript moduleA JavaScript module whose dependencies and shared bindings are declared using standardized import and export syntax.
- import statementThe import keyword statically declares dependencies on exported bindings from other ECMAScript modules.
- callbackA function supplied to another computation to be invoked when a specified event occurs or operation completes.
- for...ofJavaScript loop syntax that retrieves successive values from an iterable.
- functionA callable unit of code that can receive arguments and return a value.
- prototypeA prototype is an object from which another JavaScript object can inherit properties and methods.
- greedy matchingGreedy repetition consumes as many consecutive characters satisfying its term as possible while still allowing the overall match.
- constructor methodA JavaScript function used to create and initialize an object, typically when invoked with the new operator.
- regex captureRegular expression capture is the extraction of text matched by capturing groups for inspection or processing.
- character classA character class is a regular-expression construct that matches one character from a specified set or range.
- data streamA stream is an ordered queue-like data structure that represents values as they become available, including values that do not yet exist.
- Node.jsA standalone JavaScript runtime built around the V8 engine and designed for server-side and general-purpose applications.
- backreferenceA backreference is a regular-expression construct that matches text previously captured by a capturing group.
- regular-expression anchorAn anchor is a regular-expression construct that constrains a match to a position such as the start or end of a string.
- Array.prototype.filterA JavaScript method that creates a new array containing the elements that satisfy a predicate.
- allA JavaScript method that returns true if every array element satisfies a predicate.
- findA JavaScript method that returns the first array element satisfying a predicate, or undefined if none does.
- mapA JavaScript method that creates a new array by applying a callback to each element of an array.
- anyA JavaScript method that returns true if at least one array element satisfies a predicate.
- thisJavaScript syntax that evaluates to a function's call-dependent or lexically captured this value.
- function declarationA function definition is source code that declares a function and specifies its parameters and executable body.
- type checkingThe process of verifying that expressions, values, and operations conform to a language's declared or inferred type rules.
- ESLintAn open-source linter for JavaScript and TypeScript with configurable rules and automatic fixes.
- callA function invocation is an operation that calls a function and supplies zero or more arguments to it.
- non-greedy quantifierA non-greedy operator is a regular-expression quantifier that initially matches as little text as possible while allowing the pattern to match.
- quantifierA repetition operator is a regular-expression quantifier that specifies how many times a preceding pattern may occur.
- accumulatorAn accumulator is the intermediate value carried from one reduction step to the next and returned after the final step.
- flatThe flat method creates an array by replacing nested arrays with their elements to a specified depth.
- forEachThe forEach method is a JavaScript array method that invokes a callback for each assigned element while skipping unassigned index positions.
- Intl.CollatorIntl.Collator is a JavaScript internationalization API constructor that creates locale-sensitive string comparison objects.
- flatmapflatMap is an array method that maps each element to a value and flattens the resulting arrays by one level.
- tosortedThe toSorted method returns a sorted copy of an array without modifying the original array.
- dependency treeA hierarchical representation of a package's direct and transitive dependencies.
- arrow functionThe => token used to define an arrow function in JavaScript.
- first-class functionA function that can be treated as a value, including being assigned, passed as an argument, or returned.
- stream processingStreaming is the incremental processing or transfer of data as it becomes available rather than waiting for the complete data set.
- async/awaitJavaScript syntax for expressing asynchronous control flow using async functions and await expressions.
- function expressionA function expression is a JavaScript expression that creates a function and occurs as part of another expression or statement.
- classA class is JavaScript syntax for defining object construction and behavior that is implemented through the prototype system.
- npmThe package manager and registry ecosystem commonly used to install, publish, and manage JavaScript packages.
- live bindingA live binding is an imported reference to an exported variable whose current value reflects subsequent reassignment by the exporting module.
- named exportA named export is a module export identified by a name that importers can reference explicitly.
- node_modulesThe conventional directory in a Node.js project that contains installed JavaScript packages.
- package.jsonpackage.json is a project manifest file that records package metadata, scripts, and dependencies for JavaScript package tools.
- backtrackingRegex backtracking is a matching strategy that revisits earlier choices to try alternative paths when later matching fails.
- type hintsSyntax attached to a TypeScript declaration or expression that explicitly specifies expected types and can supply information for type checking and inference.
- ReadableStreamA Web Streams API interface representing a source of data that consumers can read incrementally.
- entry pointA package entry point is a file path that a package exposes as the target of an import specifier.
- import mapAn import map is a JSON mapping that associates JavaScript module specifiers with URLs or paths.
- pull streamA pull stream is a stream that enqueues data in response to an indication that its consumer is ready to receive it.
- regex operatorA regex operator is syntax that modifies the matching behavior of a regular-expression term or group.
- regex termA regex term is a literal, character class, group, or other pattern unit that can be matched by a regular expression.
- export keywordThe export keyword declares bindings or values that other modules can import.
- named importA named import brings a specific named export into another module, optionally under a local alias.
- namespace importA namespace import binds a module's exported names together as properties of an imported namespace object.
- new keywordThe new operator invokes a constructable function, creates an object for its this value, and returns the constructed object subject to explicit-return rules.
- expressionAn expression is a JavaScript construct that evaluates to a value and can occur within a larger expression or statement.
- iteratorAn iterator is an object that advances through a sequence and reports each successive iteration result.
- catastrophic backtrackingCatastrophic backtracking is regex backtracking whose possible paths grow exponentially and can exhaust execution time or block a thread.
- closureA closure is a function together with access to variables from its surrounding lexical environment.
- Object.definePropertyObject.defineProperty is a JavaScript built-in method that creates or modifies an object's property with a specified property descriptor.
- function argumentA value supplied to a function call for binding to a corresponding parameter.
- TypeScript compilerA tool that compiles TypeScript source code to JavaScript, optionally targeting a selected ECMAScript version.
- lookbehind assertionA lookbehind is a regular-expression assertion that checks for a pattern immediately before the current position without consuming text.
- push streamA push stream is a stream whose source produces data proactively rather than only in response to consumer requests.
- lookaheadA lookahead is a regular-expression assertion that checks for a pattern immediately after the current position without consuming text.
- bare specifierA bare specifier is a module import specifier expressed as a package name rather than a relative or absolute file path.
- exports fieldThe exports field is a package.json field that defines which package subpaths and entry points can be imported.
- PrettierPrettier is an opinionated source-code formatter for JavaScript and related languages.
- JSXJSX is a syntax extension that lets developers write XML-like markup within JavaScript code.
- assertionAn assertion is a regular-expression condition that checks surrounding text without consuming it as part of the match.
- iterableAn iterable is an object that exposes an iteration protocol allowing its values to be traversed sequentially.
- prototype chainThe linked sequence of prototype objects used for JavaScript inheritance and property lookup.
- default exportA module export designated as the value available through a default import.
- alternationRegex alternation is syntax that allows a match to satisfy one of multiple alternative pattern branches.
- regex escapingRegex escaping is the use of a backslash to make a special character match literally or to represent a control character.
- metacharacterA regex metacharacter is a character with special syntactic meaning in a regular expression.
- MapA JavaScript Map is a collection that associates keys with values and permits keys of arbitrary value types, including objects.
- linter ruleA configurable static-analysis condition that determines when a linter reports a source-code construct.
- CommonJSCommonJS is a JavaScript module-system specification traditionally based on synchronous require calls and module.exports assignments.
- non-capturing groupA non-capturing group is a parenthesized regular-expression subpattern that groups terms without storing its matched text as a capture.
- handlerA function invoked in response to an event or request to perform associated application logic.
- typescript-eslintA collection of tools and configurations for TypeScript-aware linting with ESLint.
- async functionThe async keyword marks a function whose return value is wrapped in a promise and whose thrown errors reject that promise.
- generatorA generator is a JavaScript function whose execution can suspend and resume while producing a sequence of values through an iterator.
- module namespace objectAn object that exposes a module’s exported bindings as properties.
- temporal dead zoneThe interval from entering a lexical declaration's scope until its initialization during which accessing the binding throws an error.
- deterministic finite automatonA DFA is a deterministic finite automaton that processes each input through a single state transition path without backtracking.
- node-re2node-re2 is a Node.js native binding to the RE2 regular-expression engine, which uses deterministic matching without backtracking.
- redosReDoS is a denial-of-service vulnerability in which crafted input causes a regular-expression matcher to consume excessive computational resources.
- regex engineA regex engine is software that interprets regular-expression patterns and searches or matches text according to them.
- type inferenceThe compile-time determination of types from surrounding declarations, expressions, or values without requiring explicit annotations.
- iteration resultAn object with value and done properties describing the outcome of an iterator step.
- match methodString.prototype.match is a JavaScript String method that retrieves the result of matching a string against a regular expression.
- String.prototype.matchAllString.prototype.matchAll is a JavaScript String method that returns an iterator over all matches of a regular expression in a string.
- then methodA then method accepts fulfillment and rejection callbacks, allowing an object to participate in promise-like resolution.
- bundlerA build tool that combines source modules and their dependencies into distributable output files.
- setA collection of unique items with no duplicate membership.
- as constA TypeScript const assertion that preserves literal types and applies readonly semantics to the asserted literal expression.
- code splittingA build technique that divides application code into separate output chunks, often so they can be loaded independently.
- prototype-based object orientationPrototypal inheritance is an inheritance model in which objects obtain properties and methods through links to other objects.
- JavaScript runtimeA software environment that executes JavaScript and provides access to host-platform features.
- event handlingEvent handling is the process of receiving events and invoking associated handler functions to respond to them.
- accessor descriptorAn object property whose value is accessed through getter or setter behavior rather than a directly stored value.
- default importAn import that binds a module's default export to a local name.
- default parameterA default parameter is a function parameter that receives a specified fallback value when the corresponding argument is omitted or undefined.
- single-threaded execution modelSingle-threaded execution means JavaScript code executes in one thread of control at a time.
- let keywordlet is a JavaScript keyword that declares a block-scoped, reassignable binding.
- first-class objectA value that can be assigned, stored, passed as an argument, and returned from a function.
- readonly typeA TypeScript type whose properties or elements cannot be modified through values of that type.
- immediately invoked function expressionAn immediately invoked function expression is a function expression that is invoked immediately after it is created.
- regular expression literalJavaScript literal syntax that creates a regular expression using slash delimiters and optional flags.
- ReactReact is an open-source JavaScript library for building user interfaces from declarative components.
- virtual DOMA virtual DOM is an in-memory tree representation of a user interface that can be compared with the rendered document to determine updates.
- fulfilled stateThe fulfilled state is a promise state indicating that the asynchronous operation completed successfully with a value.
- pending stateA pending state is the promise state in which the asynchronous operation has not yet fulfilled or rejected.
- rejected stateThe rejected state is a promise state indicating that the asynchronous operation failed with a rejection reason.
- transpilationThe transformation of source code from one programming-language syntax or level of abstraction into another while preserving its behavior.
- dynamic importDynamic import is an expression that loads a module at runtime and returns a promise for its module namespace object.
- server-side renderingA rendering technique in which HTML for a web page is generated on the server before being delivered to the browser.
- ImmerImmer is a JavaScript library that enables immutable updates by presenting mutable draft views and producing modified copies with structural sharing.
- tsconfig.jsonA JSON configuration file that specifies TypeScript compiler inputs, type libraries, checking settings, emission behavior, and the target ECMAScript version.
- HTMLThe standard markup language for structuring documents and content on the web.
- RegExp constructorThe RegExp constructor is the JavaScript built-in constructor that creates regular expression objects from a pattern and optional flags.
- regular expression flagA modifier that changes the matching behavior or returned information of a regular expression.
- getterA getter is an object or class property accessor that computes and returns a value when the property is read.
- setterA setter is a property accessor that receives a value when the property is assigned.
- package-lock.jsonA generated npm lockfile that records the resolved dependency tree and package versions for a project.
- development dependencyA project dependency needed for development activities such as building and testing, but not normally at application runtime.
- typed arrayA typed array is a JavaScript array-like data structure that stores elements of a specified numeric type in a raw binary representation.
- negative lookahead assertionA negative lookahead is a regular-expression assertion that succeeds when its specified pattern does not occur ahead of the current position.
- global objectThe top-level object that provides globally accessible bindings for a JavaScript execution environment.
- nextAn iterator method that advances iteration and returns an iterator result.
- backpressureBackpressure is feedback from a consumer that regulates how quickly a producer supplies data based on the consumer's capacity or demand.
- immutable collectionAn immutable collection is a collection whose contents cannot be modified after the collection is created.
- typeof operatorThe JavaScript typeof operator returns a string indicating the basic type of its operand.
- concurrencyConcurrency is the overlapping progress of multiple operations during the same period of execution.
- ProxyProxy is a JavaScript built-in object type that mediates operations on a target object through configurable interception functions.
- trapA proxy trap is a handler function that intercepts a specific operation performed through a JavaScript proxy.
- lazy initializationDeferred loading is the postponement of loading a dependency until it is needed or otherwise appropriate.
- constantconst is a JavaScript keyword that declares a block-scoped binding that must be initialized and cannot be reassigned.
- TextDecoderTextDecoder is a Web API interface that decodes binary data into text according to a specified character encoding while optionally preserving incomplete character sequences across calls.
- UTF-8A variable-width Unicode encoding that represents each Unicode scalar value using one to four bytes.
- Web StreamsThe Web Streams API is a web platform standard for creating and consuming streams of data asynchronously.
- WHATWGWHATWG is a web standards community and specification source that defines browser and runtime web platform APIs.
- global scopeThe global scope is the outermost JavaScript scope whose bindings are available across a script or execution environment.
- globalThisThe standardized JavaScript global binding that references the global object across different execution environments.
- applyA JavaScript method that invokes a function with an explicitly supplied this value and an array-like collection of arguments.
- callA JavaScript method that invokes a function with an explicitly supplied this value and individual arguments.
- module graphA graph representing modules as nodes and their import dependencies as directed edges.
- tree-shakingTree-shaking is a build-time optimization that removes unused code from a program by analyzing its module dependencies and exports.
- replace methodString.prototype.replace is a JavaScript String method that returns a new string with matched text replaced by specified text or the result of a replacement function.
- configurable propertyA configurable property is an object property whose definition may be changed or deleted when its configurable attribute is true.
- data descriptorA data descriptor is a property descriptor that specifies a property's stored value and data-property attributes.
- enumerable propertyAn enumerable property is an object property whose enumerable attribute allows it to be included by specified property-iteration and copying operations.
- event loopAn event loop is a mechanism that repeatedly processes queued tasks and callbacks to support asynchronous, event-driven execution.
- property descriptorA property descriptor is an object that specifies the attributes used to define a JavaScript property.
- read-write propertyA writable property is a data property whose stored value may be changed through assignment when its writable attribute is true.
- yieldA yield expression is an expression inside a generator function that suspends execution and evaluates to a value supplied when the generator resumes.
- Document Object ModelThe DOM is the programming interface representing a web document as a tree of objects that scripts can inspect and modify.
- inheritanceInheritance is the behavior by which a JavaScript object obtains accessible properties from its prototype chain, including both data properties and methods.
- negative lookbehindA negative lookbehind is a regular-expression assertion that succeeds when its pattern does not match immediately before the current position.
- varvar is a JavaScript declaration keyword for creating a function-scoped binding that is initialized to undefined during scope setup.
- destructuring assignmentDestructuring syntax assigns values extracted from an iterable or other structured value to program bindings.
- Promise.allA static Promise method that fulfills with an ordered array of results when all inputs fulfill and rejects if any input rejects.
- Promise.racePromise.race is a static Promise method that creates a promise settled according to the first supplied promise to settle.
- executorAn executor is the callback passed to a promise constructor that runs immediately and receives functions for resolving or rejecting the promise.
- resolveA resolve function is the function associated with a promise that resolves it with a value or causes it to adopt a thenable's outcome.
- Promise.withResolversPromise.withResolvers is a static JavaScript method that returns a new promise together with its resolve and reject functions.
- resolved promiseA resolved promise is a promise whose resolve or reject function has been called, including one that adopts the state of another promise or thenable.
- resolved stateA settled promise is a promise in either the fulfilled or rejected state whose state and associated value cannot change.
- thenableA thenable is an object with a then method whose behavior can be adopted by a promise.
- strict modeA JavaScript execution mode that applies stricter syntax and runtime semantics.
- loading waterfallA sequence of resource downloads in which each newly discovered dependency must be fetched before further dependencies can be requested.
- type coercionThe implicit conversion of a value from one type to another during an operation or expression evaluation.
- global regular expressionA regular expression configured to find successive matches throughout its input.
- dependencyA software component or package that another component requires in order to build or run.
- as operatorTypeScript syntax for asserting a compile-time type for an expression without changing its runtime value.
- frameworkA reusable software system that provides structure and core functionality for applications.
- methodA function associated with an object or class and typically invoked through that association.
- dependency graphA graph representing dependencies among components of a software project.
- assertionA zero-length assertion is a regular-expression construct that tests a condition at a position without consuming any characters in the match.
- default valueA default value is a predefined value substituted when an expected input is not provided.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.
