Skip to content

JavaScript

samme edited this page Sep 4, 2023 · 2 revisions

See JavaScript guide for details.

this

The value of this depends on in which context it appears: function, class, or global.

In JavaScript,

  • Nearly everything is an object
  • Objects can be created without classes
  • Objects can be modified after creation
  • Any function can be called as a constructor
  • Functions are values that can be passed or copied

So there's no reason this could or should work like in static object-oriented languages.

Clone this wiki locally