this post was submitted on 15 Aug 2023
13 points (93.3% liked)

No Stupid Questions (Developer Edition)

896 readers
1 users here now

This is a place where you can ask any programming / topic related to the instance questions you want!

For a more general version of this concept check out [email protected]

Icon base by Lorc under CC BY 3.0 with modifications to add a gradient

founded 1 year ago
MODERATORS
 

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

you are viewing a single comment's thread
view the rest of the comments
[โ€“] nbafantest 5 points 1 year ago* (last edited 1 year ago) (1 children)

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.

[โ€“] Skaryon 12 points 1 year ago

Small correction: typescript is a superset of JavaScript