3 ms·
The article says that it is because of structural typing, but actually it is because in TS object subtype automatically. It has little to do with structural ty
by afiori 3y ago
The article says that it is because of structural typing, but actually it is because in TS object subtype automatically.
It has little to do with structural typing per se; you would have the same behaviour with nominal classes* and inheritance.
* this is likely why OOP languages have _final_ classes