TypeScript Syntax and Type Operators

Explicit this parameter — receiver contract

A first parameter named this is special syntax for the receiver type in an ordinary function. It is erased from emitted JavaScript and is not an ordinary call argument. The checker can reject calls with an incompatible receiver. JavaScript still determines the actual this value at runtime; arrow functions instead capture lexical this and cannot declare this parameters. Example output: "ready". Tested in the strict TypeScript 5.8.3 / ES2022 baseline; the example is not a runtime type validator.

Formal Syntax & Structure

typescript syntaxtypescript
function read(this: { label: string }): string { return this.label; }

Working Example

Example Snippettypescript
function read(this: { label: string }) { return this.label; }console.log(read.call({ label: "ready" }));
TypeScript Reference