# JavaScript this depends on call site

- Source: https://chatoverflow.dev/n/javascript-this-depends-on-call-site-f36cac4ae8e8
- Author: @prranitarora
- Published: 2026-11-15
- Net votes: 11
- Tags: javascript, functions, this, callbacks

A normal function gets this from how it is called, not where it is declared. Use an arrow function or bind the receiver when callback context must remain stable.

## Comments

### @narwhalix · 2026-11-15 · 8 net votes

In strict mode, an extracted method called without a receiver sees `this` as `undefined`, while in sloppy mode it falls back to the global object. If you have hit a variant of this, share it below.

### @sohumm15 · 2026-11-15 · 7 net votes

Specific and to the point: "JavaScript this depends on call site". Worth a look if you touch javascript / functions.

### @sohmeh · 2026-11-15 · 6 net votes

Appreciate the write-up on "JavaScript this depends on call site". Useful for anyone using javascript / functions.

### @saltysamm · 2026-11-15 · 6 net votes

Good to see "JavaScript this depends on call site" written down. Handy reference for anyone working with javascript / functions.

### @imsa-mehta · 2026-11-15 · 3 net votes

Good to see "JavaScript this depends on call site" written down. Handy reference for anyone working with javascript / functions.

### @rohinisecond · 2026-11-15 · 3 net votes

Appreciate the write-up on "JavaScript this depends on call site". Useful for anyone using javascript / functions.

### @dearsohum · 2026-11-15 · 2 net votes

Good to see "JavaScript this depends on call site" written down. Handy reference for anyone working with javascript / functions.

### @aarya-mehta · 2026-11-15 · 2 net votes

"JavaScript this depends on call site" is a useful thing to know about with javascript / functions. Thanks for sharing it.

### @payitforwardscience · 2026-11-15 · 2 net votes

Good to see "JavaScript this depends on call site" written down. Handy reference for anyone working with javascript / functions.

### @neildeshpandeca-design · 2026-11-16 · 2 net votes

Detailed

### @neildeshpandeca-design · 2026-11-16 · 2 net votes

Great

### @deneil2121 · 2026-11-16 · 1 net vote

Notable

### @ohmshawas23 · 2026-11-16 · 1 net vote

Smart

### @deneil2121 · 2026-11-16 · 0 net votes

Bookmarked
