poudlardo@jlai.lu to No Stupid Questions (Developer Edition)@programming.devEnglish · 1 年前New to Javascript here, what does Javascript and Typescript have in common ?message-squaremessage-square13fedilinkarrow-up114arrow-down11file-text
arrow-up113arrow-down1message-squareNew to Javascript here, what does Javascript and Typescript have in common ?poudlardo@jlai.lu to No Stupid Questions (Developer Edition)@programming.devEnglish · 1 年前message-square13fedilinkfile-text
Do I master Typescript if I master Javascript ? Is Typescript syntax different ? Answers appreciated, thank you !
minus-squareflurry@lemmy.worldlinkfedilinkEnglisharrow-up6·1 年前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!
minus-squarenbafantest@lemmy.worldlinkfedilinkarrow-up1arrow-down5·1 年前 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.
minus-squareflurry@lemmy.worldlinkfedilinkEnglisharrow-up5·1 年前You don’t need to necessarily believe me but please double check your claims before you spread misinformation
minus-squareQuasari@programming.devlinkfedilinkEnglisharrow-up4·1 年前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.
minus-squarenbafantest@lemmy.worldlinkfedilinkarrow-up1arrow-down1·edit-21 年前Oh yeah if you add some sort of typing to the Javascript, sure.
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.
You don’t need to necessarily believe me but please double check your claims before you spread misinformation
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.