November 2018
Beginner
502 pages
10h 22m
English
This forces us to explicitly specify the any type where we want to use it. This forces us to think about our use of any and whether we really need it.
Let's explore this with an example:
export class OrderDetail { ... doSomething(input) { input.something(); return input.result; }}
tsc orderDetail --noImplicitAny
The compiler outputs the following error message because we haven't explicitly said what type the input parameter is:
orderDetail.ts(14,15): error TS7006: Parameter 'input' implicitly has an 'any' type.
Read now
Unlock full access