this is probably the most tricky thing to use in JavaScript and therefore TypeScript. Fortunately there is a TypeScript compiler flag noImplicit this that can help catch unsafe usages so beginners don't get caught off guard.

// tsconfig.json

{
"compilerOptions": {
"noImplicitThis": true, ...
}
05-28 00:47