Earlier quoted context omitted.
maybe a dumb question, but why does wikipedia say typescript is a superset of javascript? https://en.wikipedia.org/wiki/TypeScript
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…
- typescript is a superset of javascript
- superset of objects can only have the same or fewer properties
- Typescript contains all the rules of Javascript, and then adds some more
Do you see where the confusion is coming from?
> that also means the language specification itself is a strict superset of Javascript
This is where I disagree.
TS as a language has more properties than JS, but less rules. I.e. you can create Javascript language out of Typescript by adding more rules (constraints).
But TS as a spec has more rules than JS spec.
TS as a language is a superset of JS language. TS as a spec is a rough subset of JS spec.