Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the difference between typescript and es6

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you what are the differences between typescript and es6. I hope you will get something after reading this article. Let's discuss it together.

Differences: 1, TypeScript supports all original data types, while ES6 does not support all data types; 2, TypeScript has 3 scopes, while ES6 has 2 scopes; 3, modules in TypeScript are divided into internal modules and external modules, while modules in ES6 are divided into import modules and export modules.

The operating environment of this tutorial: windows7 system, ECMAScript version 6, Dell G3 computer.

TypeScript

TypeScript is a free and open source programming language developed by Microsoft. It is a superset of JavaScript and essentially adds optional static types and class-based object-oriented programming to the language.

TypeScript extends the syntax of JavaScript, so any existing JavaScript program can work under TypeScript without change. TypeScript is designed for the development of large applications, and it generates JavaScript at compile time to ensure compatibility.

TypeScript supports header files that add type information to existing JavaScript libraries, extending its benefits to popular libraries such as jQuery,MongoDB,Node.js and D3.js.

History of TypeScript

Anders Hejlsberg developed TypeScript. It was first launched to the public on October 1, 2012. After two years of internal development at Microsoft, a new version of TypeScript 0.9 was released in 2013. TypeScript 3.4.5 was released on April 24, 2019.

ES6

ECMAScript (ES) is a scripting language specification standardized by ECMA. It was created to standardize JavaScript. The ES scripting language contains many implementations, the most popular of which is JavaScript. Developers mainly use ECMAScript for client script on the World wide Web (WWW).

The sixth edition of the ECMAScript standard was ECMAScript6 or ES6, which was later renamed ECMAScript 2015. It is a major enhancement to the JavaScript language that allows us to write programs for complex applications. It adds a number of features designed to simplify large-scale software development. The most common ES6 web browsers are Chrome and Firefox. The translator converts ES6-based code into ES5 that supports many browsers. TypeScript is a translator. Grunt, Gulp, and Babel are other translators for the compilation module. Therefore, TypeScript supports ES6.

History

JavaScript was introduced by Brendan Eich in May 1995. Originally called Mocha, it was chosen by Marc Andreessen, the founder of Netscape, and later renamed LiveScript. At the same time, Sun Microsystems has the trademark JavaScript. In December 1995, Netscape obtained a trademark license and renamed it JavaScript.

Between 1996 and 1997, Netscape brought JavaScript to the ECMA standards organization to maintain the language specification. In June 1997, the ECMA Technical Committee 39 (TC39) was created to continue the development of the language, resulting in the release of ECMA-262 Ed.1.

The first standard version of JavaScript, ECMAScript 1, was released in June 1997. A year later, ECMAScript 2 was released with only minor changes to maintain JavaScript's parallel ISO standard. In December 1999, ECMAScript 3 was released, introducing many of the popular features of JavaScript. In December 2009, ECMAScript or ES6 was released and subsequently renamed ECMAScript 2015.

The difference between TypeScript and ES6

1. Original data type

TypeScript supports all raw data types, while ES6 does not support all data types.

2. Variable scope

TypeScript has three scopes: global scope, class scope, and local scope.

ES6 has two scopes: global scope and local scope.

3. Module

In TypeScript, there are two types of modules: internal and external modules

In ES6, modules are divided into import modules and export modules.

After reading this article, I believe you have a certain understanding of "what are the differences between typescript and es6". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 257

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report