February 2019
Beginner
694 pages
18h 4m
English
The noImplicitAny compiler option is used to check whether function declarations or expressions have not been strictly typed, and will therefore (by default) return an any type. This can be explained through a simple code sample, as follows:
declare function testImplicitAny();
function testNoType(value) {
}
Here, we start with the declaration of a function named testImplicitAny. We then create a function named testNoType that has a single parameter named value. If we compile this code with the noImplicitAny compile option set to true, the compiler will generate the following errors:
error TS7010: 'testImplicitAny', which lacks return-type annotation, implicitly has an 'any' return type. error TS7006: Parameter 'value' implicitly ...
Read now
Unlock full access