this
Learning how to use this
in JavaScript is something of a rite of passage. Since TypeScript is a superset of JavaScript, TypeScript developers also need to learn how to use this
and how to spot when it’s not being used correctly. Fortunately, TypeScript lets you catch incorrect uses of this
with a couple of techniques. If you need to learn how this
works in JavaScript, though, first read Yehuda Katz’s Understanding JavaScript Function Invocation and “this”. Yehuda’s article explains the inner workings of this
very well, so we’ll just cover the basics here.
Please login to continue.