Typescript is compatible with es6. TypeScript supports ES6 (modules, destructuring, spread, for..of, symbols, computed properties, let/const) starting from 1.5; TypeScript supports modules and the latest modules syntax of ES6, and also supports the Decorator feature of ES7.
The operating environment of this tutorial: Windows 7 system, ECMAScript version 6, Dell G3 computer.
TypeScript 1.5 is officially released to support ES6
TypeScript 1.5 is officially released, this version is Visual Studio 2015 Part of the update can be downloaded from download for Visual Studio 2013, npm or GitHub Get the latest version.
Notable improvements
ES6 support (modules, destructuring, spread, for..of, symbols, computed properties, let/const, andtagged string templates)
In addition, TypeScript 1.5 supports the latest modules syntax of modules and ES6; simplifies modules; supports new module output; the compiler supports 'tsconfig.json'; Support the Decorator feature of ES7; better use AngularJS. Please see Release Notes for detailed improvements.
TypeScript is a new language launched by Microsoft, based on JavaScript, which is ultimately compiled and generated by tools. TypeScript is compatible with JavaScript and can load JavaScript code and then run it. The improvements of TypeScript compared with JavaScript include: adding comments to let the compiler understand the supported objects and functions, and the compiler will remove the comments without increasing overhead; adding a complete class structure, making it a completely new aspect object language.
The connections and differences between JavaScript, TypeScript and ES6
What is ES6
ECMAScript 6.0 (hereinafter referred to as ES6) is the next generation standard of the JavaScript language (now following the ES5 standard) and has been officially released in June 2015. Its goal is to enable the JavaScript language to be used to write complex large-scale applications and become an enterprise-level development language.
New features of ES6
The relationship between ECMAScript and JavaScript
Due to copyright issues with Netscae, the creator of JavaScript, ECMAScript cannot be called Javascript. In short, the relationship between ECMAScript and JavaScript is that the former is the specification (language specification) of the latter, and the latter is an implementation of the former.
The relationship between JavaScript and TypeScript
TypeScript is a superset of Javascript that implements the use of Javascript in an object-oriented programming manner. Of course, the final code is still compiled into Javascript.
The relationship between TypeScript and ES6
typescript Compared with ES6, the biggest improvement of TypeScript is the addition of the type system.
Attachment: Typescript has five major improvements compared to ES5:
TypeScript is a superset of ES6. Whether you need to use it or not depends on the scenario you need. For example, in Angular2, using TypeScript is obviously better than ES6.
To summarize:
ES6 is the standard for Javascript language, and typescript is a superset of ES6.
【Related recommendations: javascript video tutorial, programming video】
The above is the detailed content of Is typescript compatible with es6?. For more information, please follow other related articles on the PHP Chinese website!