October 2017
Intermediate to advanced
280 pages
6h 50m
English
Sometimes, the type inference could be a result of several expressions. Such is the case when we assign a heterogeneous array to a variable:
let x = ['42', 42];
In this case, the type of x will be any[]. However, suppose we have the following:
let x = [42, null, 32];
The type of x will then be number[] since the Number type is a subtype of Null.
Read now
Unlock full access