|
|
|
|
|
by sirmarksalot
1245 days ago
|
|
Because Typescript is designed to accept any valid Javascript program, the set of valid statements in a Typescript program is a superset of the set of valid statements in a Javascript program. Typescript contains all the rules of Javascript, and then adds some more, but never in a way that contradicts the requirement that a plain Javascript program should compile, so that also means the language specification itself is a strict superset of Javascript. |
|
That's not strictly true though. `a<b,c>(d)` is valid Javascript but Typescript treats it as a different syntactic construct[0].
[0] https://www.typescriptlang.org/play?#code/C4TwDgpgBARlC8UB2B...