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

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

    It’s going to be hard to explain to a new person.

    Typescript is a subset of Javascript. All typescript compiles to Javascript.

    There are large class of bugs/faulty logic that occurs in code, you might have noticed this with Javascript if you add the string/text to an integer, something like “5”+1, returns “51”.

    It might not behave how you would expect. Maybe the dev was lazy or tired and forgot to convert the string to an integer.

    Typescript runs some logic checking on the code to make sure we catch these bugs before they make it to a website and cause real problems for users.

    Generally learning either of them is fine, typescript might be harder at first since you need to compile it to Javascript. And there probably are more resources for Javascript as well.