Deep Analysis ES6 Series (i)

Source: Internet
Author: User

Brief introduction

Welcome to the Deep Exploration es6! In this new week series, we will explore ECMAScript 6. This is a new version of the JavaScript language that is coming soon. ES6 contains a lot of new language features, and these language features make JS more powerful and expressive. In the next few weeks, we'll get to know these new features one by one. But before we get into the details, it's worth taking a moment to discuss what ES6 is and what you expect to get.

What is the scope of the ECMAScript?

The JavaScript programming language is standardized by the ECMA in the name of the ECMAScript (the ECMA is a standardized organization like the one in the paper). In addition, ECMAScript can be defined as follows:

    • Syntax-parsing rules, keywords, statements, declarations, actions, and so on.

    • Type-Boolean, number, String, object, and so on.

    • Prototypes and inheritance.

    • A standard library of built-in objects and functions-JSON, Math (math), array methods (arrays methods), Object-introspective methods (objects introspection methods), and so on.

It does not define content that interacts with HTML, CSS, or Web APIs, such as the DOM (Document Object model). Those are defined in a separate standard. ECMAScript not only covers all aspects of JS in a browser environment, it also covers JS in non-browser environments, such as node. js.

The new standard

Last week, the final draft of the ECMAScript Language Specification, 6th Edition, was submitted to the ECMA Congress for review. What does that mean?

This means that this summer, for the core JavaScript programming language, we will have a new standard.

This is a big news. The new JS language is not likely to occur every day. The previous version, ES5, dates back to 2009. Since then, the ES Standards Committee has been committed to ES6 's development until today.

ES6 is a major upgrade to the language. At the same time, your JS code can continue to work. ES6 is designed to maximize compatibility with existing code. In fact, many browsers already support the rich ES6 functionality, while the implementation work is in progress. This means that all of your JS code can already be run in browsers that implement some ES6 features! If you haven't seen any compatibility issues yet, you may never get to these problems.

Count to 6

The previous versions of the ECMAScript standard are numbered 5 and three respectively.

What happened in version IV? The 4th edition of ECMAScript was planned, and in fact a lot of work was done. But because it was too cumbersome, it was eventually scrapped. (for example, it has a complex choice for generics and type inference in a static type system.) )

The ES4 is controversial. When the standard committee finally stopped working, the Committee members agreed to publish a relatively modest ES5, and then continue to work to develop more new features with a larger range of improvements. This direct negotiated agreement is called "Harmony (Harmony)", which is why the ES5 specification contains these two words:

ECMAScript is a vibrant language and the evolution of its language is incomplete. In the future version of ECMAScript there will be a statement of the larger lifting technology.

Such a statement could also be seen as a promise made by the Commission.

Fulfilling commitments

ES5 updated the language in 2009, which introduced Object.create (), Object.defineproperty (), Getter and setter methods, s Trict mode and JSON objects. I've used all of these features, and I love ES5 's contribution to language. However, none of these features has a huge impact on the way I write JS code. The most important innovation for me is probably the new array method:. Map,filter and so on.

However, ES6 is decidedly different. It is the product of many years of harmonious work. At the same time, it is a treasure trove of new language and library functions, which is by far the most substantial upgrade of JS. Its new features cover a wide range of features, from those that are popular for convenience (such as the function of arrows and simple string interpolation), to concepts such as proxies and generators that can bring brainstorming.

ES6 will change the way you write JS code.

This series is designed to show you how ES6 can provide a new writing code experience for JavaScript programmers by examining their new features.

We will start with a typical "function missing". "Feature missing" is what I've been longing to see from JavaScript for the past ten years. So let's explore the ES6 iterator and the new for-of loop together.

Managed Address: http://wiki.jikexueyuan.com/project/es-six-deeply/an-introduction.html

Deep Analysis ES6 Series (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.