The binding of "this" is dependant of the callee and the environment of your TypeScript code. In a browser environment, the global object refers to "window" which can be referenced by "this". In Node.js, the global object is called "global" and can also be referenced by "this". In his video, Benny will explain you how "this" behaves and how you can change its default behaviour.
My FREE programming apps:
apps.apple.com/app/id659282498
play.google.com/store/apps/details?id=com.weloveco…
My FREE TypeScript Course:
typescript.tv/
Timeline:
00:06 this in functions
03:56 this in objects
07:16 this in strict mode
08:33 self & call
10:34 this in arrow functions
12:55 Method vs. Function
13:26 this in TypeScript
19:11 TypeScript in your browser
20:43 this contexts
22:24 Outro
Resources:
➜ typescript.tv/errors/
➜ blog.logrocket.com/what-is-globalthis-why-use-it/
➜ developer.mozilla.org/en-US/docs/Web/JavaScript/Re…
Follow TypeScript TV:
🌐 typescript.tv/
🐦 twitter.com/typescripttv
📺 youtube.com/typescripttv
Hashtags:
#TypeScript #JavaScript #this
コメント