Gollum@feddit.org to Programmer Humor@programming.dev · 2 days agoThis is literally mefeddit.orgimagemessage-square41linkfedilinkarrow-up1394arrow-down114
arrow-up1380arrow-down1imageThis is literally mefeddit.orgGollum@feddit.org to Programmer Humor@programming.dev · 2 days agomessage-square41linkfedilink
minus-squarehumorlessrepost@lemmy.worldlinkfedilinkEnglisharrow-up2·22 hours 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-squaremercano@lemmy.worldlinkfedilinkarrow-up3·21 hours 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.)
minus-squareCookieOfFortune@lemmy.worldlinkfedilinkarrow-up1·19 hours agoIn practice people don’t use Typescript as a superset since they have stricter compiler settings, which would make valid JavaScript fail to compile.
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?
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.)
In practice people don’t use Typescript as a superset since they have stricter compiler settings, which would make valid JavaScript fail to compile.