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, ... }
时间: 2024-10-13 11:01:42