this post was submitted on 15 Aug 2023
13 points (93.3% liked)
No Stupid Questions (Developer Edition)
923 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
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
TypeScript is a superset of JavaScript. It means any valid JavaScript is also valid TypeScript.
You should start to learn basic JavaScript mechanisms : prototype inheritance, hoisting, scopes, this, event loop, type coercion.
Once « JavaScript » sounds familiar you will embrace TypeScript which is JavaScript with steroids!
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.
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.Oh yeah if you add some sort of typing to the Javascript, sure.