Grokking TypeScript
0% completed
Enforcing Strict Mode
The following function looks harmless, yet the compiler rejects it twice.
function add(a, b) { // Error return a + b; }
error TS7006: Parameter 'a' implicitly has an 'any' type. error TS7006: Parameter 'b' implicitly has an 'any' type.
These errors come from strict mode, a group of type-checking rules controlled by one option called strict. Most of the rules exist to stop a value from quietly having a type that the compiler cannot check, and the sections below follow the rules that you will meet most often.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%