Gollum@feddit.org to Programmer Humor@programming.dev · 4 months agoThis is literally mefeddit.orgimagemessage-square42fedilinkarrow-up1369arrow-down113
arrow-up1356arrow-down1imageThis is literally mefeddit.orgGollum@feddit.org to Programmer Humor@programming.dev · 4 months agomessage-square42fedilink
minus-squarehumorlessrepost@lemmy.worldlinkfedilinkEnglisharrow-up2·4 months agoGenuine question: is it really a superset if it’s not still valid javascript? Isn’t it more of an abstraction layer on top of javascript?
minus-squareCookieOfFortune@lemmy.worldlinkfedilinkarrow-up1·4 months agoIn practice people don’t use Typescript as a superset since they have stricter compiler settings, which would make valid JavaScript fail to compile.
minus-squaremercano@lemmy.worldlinkfedilinkarrow-up1·4 months agoSuperset means all valid JavaScript is also valid Typescript. (At least, so long as you don’t have compiler setting on that requires all variables to have a type declared.)
Genuine question: is it really a superset if it’s not still valid javascript? Isn’t it more of an abstraction layer on top of javascript?
In practice people don’t use Typescript as a superset since they have stricter compiler settings, which would make valid JavaScript fail to compile.
Superset means all valid JavaScript is also valid Typescript. (At least, so long as you don’t have compiler setting on that requires all variables to have a type declared.)