ES6 new features (continuous update)

Source: Internet
Author: User

ES6 today officially released (Roadside News), anyway, it will be released this month, before a lot of ES6 features have been fired very hot, but the total feeling and we have little relationship, because either some have not supported, or practicality is not very large, But today is a method that you must be familiar with or have used or heard.

Believe that engaged in the front-end must have used angular bar, not have heard its name it, one of its characteristics is two-way binding, such as the page binding a variable, when the variable changes, the page code is updated immediately. In fact, is to listen to a variable change, we know that the input tag in the HTML5 has a change method, when the value of the tag will be triggered when the switch event, you can implement the change when you update the variable, but when you want to listen to a variable how to listen? The original is no way, to do only set a timer, regularly check this variable has not changed, but it is very expensive, although angular also do so, but others are to minimize the cost. But now with the ES6 feature, this feature can be easily implemented.

Object.observe (Value,function () {});

var modal = {"A": 1}object.observe (modal,function= 2

When the modal changes, it will trigger the method immediately, this time we can do the corresponding update operation. Isn't it cool? But I've only tried it in chrome 36.0 or above, and you're interested in trying it out for yourself.

ES6 new features (continuous update)

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.