What distinguishes JavaScript from TypeScript?

Rahul Nair
3 replies
JavaScript is one of the most common programming languages, but it’s not suitable for every kind of application right. So how Typescript can be used to fill the gap?


Fabian Maume
TypeScript is a super set of Javascript. You can include Javascript code in TypeScript, but Javascript engine cannot interpret TypeScript straight away. TypeScript is strongly typed and you need to compile to Javascript to deploy it. The idea is you will detect issue with the code during compile rather than in production.
Jeff Zhang
@fabian_maume It sounds like TS is hands down better for writing typed code. In your opinion, what's the advantages of JS
Jesús Zorrilla
I'd built some large apps with javascript before, also using typescript. It just pays its bills to have a good an flexible type inference, also when using npm you'll get a lot of useful resources (libraries) with types files so you can by example explore really easy methods and clases without executing the code. Think about painting a circle with paperjs and delete an item with Mongo adapter, both methods can be found really fast with a good intelisense engine.