|
|
|
|
|
by johnfn
1232 days ago
|
|
>
strict typing is great, but the rest of TS features are just trying to put Java into Javascript There are no other features of TS that aren't static typing. It is only static typing. (OK, I suppose you could make an argument for enums, but it's still 99%.) |
|
Like... Half the original point of TS was to add features to JS that weren't there originally.
Granted, as the base language evolved the gap has become smaller, but it's still there.
Interfaces being one such example.
There's also things you can do in JS that TS will bitch about. For example, try using object destructuring in a class constructor to create optional named parameters for a class.
Works perfectly in Vanilla JS, but TS will throw a hissy-fit.