Reputation: 2940
Typescript started by claiming that it is a superset of Javascript. Now with ES6 around the corner. Does the current typescript transpiler/compiler support all the es6 features and syntax as it is or does it deviate from es6 interms of syntax for module export/import, arrow functions, etc?
I am asking because I am trying to learn angular 2.0 but am not able to decide whether to follow typescript path or vanilla JS path.
Upvotes: 2
Views: 554
Reputation: 8605
On top of Mark's answer, I should add that TypeScript and other transpilers allow you to use several ES6 features today. I wouldn't dream of launching a public facing website built entirely using ES6 today (early 2017), because old browsers don't die easy. TypeScript removes that inhibition altogether and also adds some innovations of its own.
Upvotes: 2
Reputation: 364697
Regarding features, see What's new in TypeScript and the Roadmap. (There doesn't seem to be any page that directly compares ES6/ES2015 features to TypeScript though. See @alexpod's answer.)
I suggest you use TypeScript, if for nothing else, for the extra type checking. When Angular converted their code over to TypeScript, it revealed a number of bugs.
TypeScript's primary purpose is not to add features to JavaScript – as is the purpose of ES2015 – but to make it easier and safer for developers to write and maintain large JavaScript applications. The primary benefit of TypeScript shows up before your application runs – when you're writing or maintaining code. Intellisense, code completion, type checking, etc.
Upvotes: 6
Reputation: 48505
Look at this table. It will show you what typescript and other transpilers/environments support right now.
Upvotes: 3