/xx @type {number} x/ Foo.prototype.bar = 1;
This property may only hold number values, and an assignment to any other type of value is an error. INFERRED properties do not have an explicit type annotation. Rather, we try to find all the possible types that this property can hold. Foo.prototype.bar = 1;
If the programmer assigns other types of values to this property, the property will take on the union of all these types. UNKNOWN properties are properties on the UNKNOWN type. The UNKNOWN type has all properties, but we do not know whether they are declared or inferred.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|