Actually, the question is: how does JavaScript differ from ES6, EC2015 and TypeScript? No one really can answer me on the merits. Why do I need TS for Angular 2?

  • Because in ES6 a lot of new . But there are still recommendations for ES7, for example async / await In angular2, you do not necessarily need TS, just the vast majority of examples on TS. - Mr. Brightside
  • i.e. ec5 / 6 for javascript is it like sass for css? - programming noob
  • one
    No, it's JS spec. JS, like other languages, has new versions, new specifications. This is not like sass for css, it is like python 2 and python 3. In your question, TS is more like sass for css. You may be confused by the need to translate ES6 to ES5 - this is necessary so that your code written on ES6 can work in all browsers that do not yet support ES6. - Mr. Brightside
  • Why do I need TS for Angular 2? - no why. For Angulyar2 you can use JS, TS, Dart - Grundy

2 answers 2

JavaScript from ES6 and ES2015 is no different.

JavaScript is the historical name for a programming language.

ES - ECMAScript - This is a JavaScript specification that describes how this language should work.

ES5, ES6 - These are versions of this specification.

ES2015 - This is the second name of ES6, starting with this version each following specification will include the year in which it is made.

TS - TypeScript - This is a JS based language that extends its capabilities. Works like scss.

For Angular 2, TypeScript was chosen because of its capabilities. Angular2 itself is written in TypeScript. Applications on Angular 2 can be written on both ES6 and ES5, but the standard Tutorial is written on TS.

  • Excellent answer, I would only "JavaScript from ES6 and ES2015 is no different.", Since this is not quite true. - Vadim Ovchinnikov
  • @VadimOvchinnikov Explain why and how they differ? - dbellkoff
  • Well, it's like a tomato and a cucumber, you know? JavaScript is a programming language, EcmaScript is a specification. Why did you decide that this is the same thing? - Vadim Ovchinnikov
  • @VadimOvchinnikov Yes, I meant that when we say JS / ES6 / ES2015, we are talking, essentially, about one thing, about JS. It's easier to understand, ES === JS :) - dbellkoff
  • In general, I thought that any beginner in JS begins his journey with learn.javascript.ru where at the very beginning explain most of the questions of the topic starter - dbellkoff

All languages ​​are evolving. Javascript makes it slower due to the paravoz of browsers that need to be supported.

At the same time, very large and complex applications are written on JS, therefore without development anywhere. Weak JS typing and the lack of a normal OOP do not allow writing reliable scalable applications on it.

ES6 (ECMA2015) extends the standard with new features, such as classes.

Typescript simply implements them and allows you to write to ES6 + now typed. Just try: start simple, you can write as in JS.

  • "I turn on the mode of bore": 1. And what, reliable scalable applications without OOP can not write? 2. In js there are no full-fledged classes from the point of view of java-like, the keyword class is small sugar, there are more interesting things in the standard - Duck Learns to Hide
  • Well, in general, this is petty quibbles, of course, so I plyusanul) - Duck Learns to Take Cover