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)