this post was submitted on 15 Aug 2023
13 points (93.3% liked)
No Stupid Questions (Developer Edition)
896 readers
1 users here now
This is a place where you can ask any programming / topic related to the instance questions you want!
For a more general version of this concept check out [email protected]
Icon base by Lorc under CC BY 3.0 with modifications to add a gradient
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
This is backwards. JS is superset and all TS compiles to valid JS.
The vast majority of JS does not translate to Typescript as the JS is untyped.
You don’t necessarily need to believe me but please double check your claims before you spread misinformation
To be a superset, all elements of the subset must be contained within the superset.
TypeScript is a superset of JavaScript as valid JS code(just with everything implicitly the
any
type) is valid TS code.Oh yeah if you add some sort of typing to the Javascript, sure.