• humorlessrepost@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    22 hours ago

    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?

    • mercano@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      21 hours ago

      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.)

    • CookieOfFortune@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      19 hours ago

      In practice people don’t use Typescript as a superset since they have stricter compiler settings, which would make valid JavaScript fail to compile.