liveBook · Manning

This

In JavaScript, the this value is determined by a function’s call context or, for an arrow function, inherited lexically.

How 4 Manning books explain it

Secrets of the JavaScript Ninja, Second Edition

The implicit JavaScript function binding whose value is determined by how the function is called.

How it is used
Determines which object function code accesses through `this`, especially in methods, constructors, and callbacks.
How deep it goes
Works through four invocation forms and callback remedies, while deferring detailed event handling.
Examples
Contrasts calls through two objects and traces a click handler that updates the wrong object.
What you can do after
Diagnose/debug with it when callbacks lose their intended context, then use `bind` or an appropriately placed arrow function.

Read how Secrets of the JavaScript Ninja, Second Edition explains this →

Essential TypeScript 5, Third Edition

The this value is the object or other value associated with a JavaScript function invocation or lexical function context.

How it is used
Controls which object’s properties methods and callbacks read, particularly when a function is detached or used as an event handler.
How deep it goes
Works through stand-alone calls, methods, call, bind, and enclosing arrow functions, then applies the behavior to a TSX handler.
Examples
Contrasts direct and detached message calls, repairs a price-display method with bind, and uses arrow handlers in a TSX product item.
What you can do after
Diagnose/debug with it when detached methods read unexpected properties, and choose bind or an enclosing arrow for consistent callback behavior.

Read how Essential TypeScript 5, Third Edition explains this →

Build a Frontend Web Framework (From Scratch)

The JavaScript binding that determines the object supplied as the this value during a function call.

How it is used
Binds component render and event-handler callbacks to the component instance so state updates target the intended component.
How deep it goes
Explains callback binding, contrasts class methods, and implements explicit binding with call(), without surveying all JavaScript binding rules.
Examples
Uses a counter component, an increment button, and a parent handling a child’s emitted event.
What you can do after
Apply it via Function.call to preserve component context in render callbacks and event handlers.

Read how Build a Frontend Web Framework (From Scratch) explains this →

The Joy of JavaScript

this is a JavaScript binding whose value depends on the call site and refers to the current execution context or receiver.

How it is used
Uses this to access object state while decomposing a hashing method into smaller, composable functions.
How deep it goes
Explains context assumptions, dynamic binding, and explicit-parameter refactoring, but does not develop a complete call-site taxonomy.
Examples
Uses assemble, computeCipher, calculateHash, bind, and explicit object arguments in hashing examples.
What you can do after
Diagnoses hidden context dependencies and refactors this-based property access into explicit, composable functions.

Read how The Joy of JavaScript explains this →

Related concepts

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.