Do I master Typescript if I master Javascript ? Is Typescript syntax different ? Answers appreciated, thank you !

  • nbafantest@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    5
    ·
    1 year ago

    TypeScript is a superset of JavaScript. It means any valid JavaScript is also valid TypeScript.

    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.

    • flurry@lemmy.world
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 year ago

      You don’t need to necessarily believe me but please double check your claims before you spread misinformation

    • Quasari@programming.dev
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 year ago

      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.