alhassy / alhassy/JavaScriptCheatSheet

`this` is not tied to the function

Offen
#5 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
help wanted
Vorherrschende Sprache
Keine Sprachdaten
Sterne
221
Forks
23
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

There's a section called:

> The this of Parent Scopes

And it starts by saying:

> Since each function has its own `this` binding, whose value depends on the way it is called, you cannot refer to the `this` of the wrapping scope in a regular function defined with the function keyword.

This is incorrectly worded. There is no concept at all of "the `this` of a scope", as it's not associated to a _scope_. So the title is not correct. Also the explanation will be confusing to novices because it, again, relates `this` to some wrapping _scope_.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.