Expressions

this expression

Try the free JavaScript compiler

Resolves the current this binding. Ordinary calls depend on invocation form and strictness; arrow functions capture an enclosing this binding. In an ordinary property call, the receiver supplies this.

Formal Syntax & Structure

javascript syntaxjavascript
this

Working Example

Example Snippetjavascript
const a={n:2,f(){return this.n;}}; const b={n:8,f:a.f};console.log(a.f(),b.f());
JavaScript Reference