I'm learning Angular2. What is the difference between Angular2 with typescript and angular2 with ecmascript?
TypeScript is a free and open-source pure object-oriented programming language. It is developed and maintained by Microsoft. ES6 is a version of ECMAScript (ES), which is a scripting language specification standardized by ECMA international. Typescript is to eradicate the development errors.
ECMAScript, also known as JavaScript, is a programming language adopted by the European Computer Manufacturer's Association as a standard for performing computations in Web applications.
Its declarative style makes it easy to define and add features without a lot of manually written boilerplate, and the fully integrated TypeScript language gives you the benefits of a statically typed language within the JavaScript ecosystem.
Features. TypeScript is a language extension that adds features to ECMAScript 6. Additional features include: Type annotations and compile-time type checking.
ECMAScript is the standard. JavaScript is the implementation. When people say ECMAScript they often mean JavaScript... the JavaScript that browsers understand.
Typescript is a "typed superset of JavaScript that compiles/transpiles to JavaScript." Today, that means you'll compile/transpile your TypeScript code into ECMAScript 5/ES5, since most browsers support that version. In the future, as browser support grows for ECMASCript 6/ES6/ES2015, you could compile your TypeScript into ES2015 instead of ES5.
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, the ability to use ES2015 features today, etc.
Angular 2 is written in TypeScript. If you write Angular 2 applications, I strongly recommend that you use TypeScript.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With