Arrow function
An arrow function is a JavaScript function expression written with arrow syntax that uses lexical binding for this and has no own arguments object.
Functional Programming in JavaScript
An anonymous function expression, typically used as a value or inline callback.
- How it is used
- Supplies concise callback behavior to higher-order array operations that replace manual loops.
- How deep it goes
- Defines one-line implicit returns, multi-statement bodies, and equivalence with regular anonymous functions without examining runtime internals.
- Examples
- Uses squaring arrays, extracting person names, validating values, filtering by birth year, and small arithmetic functions.
- What you can do after
- Apply it via JavaScript array operations to express transformations and predicates without manual loop control.
Read how Functional Programming in JavaScript explains arrow function →
Web Components in Action
An ECMAScript function expression written with arrow syntax that lexically captures the surrounding this value.
- How it is used
- Preserves class-instance scope when Web Components handle mouse events, button clicks, or timers.
- How deep it goes
- Defines lexical scope through working event examples, but does not develop broader function semantics or implementation internals.
- Examples
- Uses photo-carousel button handlers, Web Harp mouse movement, and delayed strum cleanup as concrete callback examples.
- What you can do after
- Apply it in event listeners and timers while retaining access to component state and methods.
Essential TypeScript 5, Third Edition
An arrow function is a concise JavaScript function syntax using an arrow between its parameters and body or result expression.
- How it is used
- Uses concise functions for array callbacks and event handlers where access to an enclosing `this` matters.
- How deep it goes
- Explains expression results, function values, and `this` through examples, including a method-replacement failure; does not detail arrow-function internals.
- Examples
- Shows price summation with `reduce`, a returned greeting function, and a product quantity-change handler.
- What you can do after
- Apply arrow syntax to callbacks and handlers, and diagnose incorrect `this` when replacing a regular method.
Read how Essential TypeScript 5, Third Edition explains arrow function →
Secrets of the JavaScript Ninja, Third Edition
The => token used to define an arrow function in JavaScript.
- How it is used
- Uses arrow functions to shorten function definitions and make callback context predictable.
- How deep it goes
- Explains parameter and body forms, then works through lexical `this` and its behavior with `call`, `apply`, and `bind`.
- Examples
- Uses greeting and hypotenuse functions alongside an event handler whose click count breaks when its method is passed unbound.
- What you can do after
- Practice/perform writing concise callbacks and choosing a wrapper when an ordinary object's method needs its invocation context.
Read how Secrets of the JavaScript Ninja, Third Edition explains arrow function →
Secrets of the JavaScript Ninja, Second Edition
A concise JavaScript function syntax that captures this lexically from its creation context rather than creating its own binding.
- How it is used
- Uses arrow functions for concise callbacks and for preserving `this` in browser event handlers.
- How deep it goes
- Works through parameter and body forms plus lexical `this` in callbacks, while leaving browser-compatibility details to a linked resource.
- Examples
- Compares array-sort and greeting functions, then contrasts constructor and object-literal click handlers.
- What you can do after
- Diagnose/debug with it when a browser click callback changes the wrong object's state.
Read how Secrets of the JavaScript Ninja, Second Edition explains arrow function →
Pro Angular 16
An arrow function is JavaScript function syntax with lexical this binding and a concise expression form.
- How it is used
- Uses concise functions as callbacks, function arguments, inline behavior, and array filters in TypeScript and Angular examples.
- How deep it goes
- Explains parameters, return types, invocation, inline definitions, closures, and filtering, but does not develop broader function semantics.
- Examples
- Demonstrates city-producing functions, Paris and Rome closures, and filtering incomplete todo items.
- What you can do after
- Apply it via concise callbacks, typed function arguments, inline functions, and closure-based functions.
Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond
A concise function expression form with lexical this binding in JavaScript.
- How it is used
- Uses arrow functions to shorten inline callbacks and preserve the surrounding `this` without a saved variable or callback context argument.
- How deep it goes
- Explains syntax, implicit returns, lexical `this`, and common traps through short comparisons; stops short of language-specification internals.
- Examples
- Works through exponent calculation and object-property mapping, then contrasts object-literal returns and jQuery callbacks.
- What you can do after
- Practice/perform arrow-function refactors of callbacks while checking whether lexical `this` matches what the callback API expects.
D3.js in Action, Third Edition
An arrow function is JavaScript function syntax that uses an arrow notation and supports concise expression or block bodies.
- How it is used
- Uses arrow functions as D3 accessors for assigning data-driven SVG attributes.
- How deep it goes
- Explains parameter formatting, expression versus block bodies, returns, and index-based positioning without covering broader function behavior.
- Examples
- Demonstrates bar-chart rectangles, data-derived widths, indexed vertical positions, multiline class accessors, and conditional colors.
- What you can do after
- Apply arrow functions in D3 chains to calculate SVG dimensions, positions, classes, and colors from bound data.
Read how D3.js in Action, Third Edition explains arrow function →
JavaScript in Depth
A JavaScript function form with lexical this behavior and a restricted set of function capabilities compared with ordinary functions.
- How it is used
- Uses lexical this for callbacks and short inline functions that do not need constructor behavior or an arguments object.
- How deep it goes
- Explains internal slots, creation-time this capture, constructor restrictions, and rest-parameter replacement for arguments access.
- Examples
- Demonstrates delayed cabinet callbacks, failed construction with new, and collecting arguments through a rest parameter.
- What you can do after
- Diagnose callback this bugs, choose arrows for lexical binding, and replace missing arguments access with rest parameters.
Also covered in
- BDD in Action, Second Edition
- React Quickly, Second Edition
- Build a Frontend Web Framework (From Scratch)
What to know first
- thisIn JavaScript, the this value is determined by a function’s call context or, for an arrow function, inherited lexically.
- JavaScriptJavaScript is a high-level, dynamically typed programming language standardized as ECMAScript and used for web and general-purpose programming.
- objectAn object is a distinct entity represented or manipulated within a computational system, typically as a value, data structure, resource, or instance of a type.
- arrayAn array is an ordered collection of elements organized in one or more dimensions and accessible by position or index.
Related concepts
- thisuses · In JavaScript, the this value is determined by a function’s call context or, for an arrow function, inherited lexically.
- functionkind of · A function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
- lexical scopinguses · Lexical scoping is a rule for resolving identifiers according to the static textual nesting of their declarations and references in source code.
- function bindingcontrasts with · Function binding is the creation of a function with a predetermined this value and, optionally, preset arguments.
Questions about arrow function
What is arrow function?
An arrow function is a JavaScript function expression written with arrow syntax that uses lexical binding for this and has no own arguments object.
Which Manning books explain arrow function?
Functional Programming in JavaScript, Web Components in Action, Essential TypeScript 5, Third Edition, Secrets of the JavaScript Ninja, Third Edition, Secrets of the JavaScript Ninja, Second Edition, Pro Angular 16, Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond, D3.js in Action, Third Edition and 1 more.
What should I know before learning arrow function?
Manning books that teach arrow function usually introduce this, JavaScript, object and array first.
What is the difference between arrow function and [[Construct]]?
An arrow function is a JavaScript function expression written with arrow syntax that uses lexical binding for this and has no own arguments object. An internal function slot that enables a function object to create an object when invoked with the new operator.
What is arrow function a kind of?
Arrow function is a kind of function. A function is a callable unit of program code that performs a computation or operation, can accept inputs, and may produce a result or side effect.
What is arrow function also called?
Arrow function is also called arrow syntax or lambda expressions.
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.








