官术网_书友最值得收藏!

JavaScript of the future

It was not so long ago that somebody asked me whether we should really use the bind function of ECMAScript 5.1, as then we'd probably run into browser compatibility issues. The web moves very fast, and we need to keep up the pace. We can't write code that does not use the latest features, even if this would cause issues in old browsers.

The fantastic people from TC39, the technical committee that is responsible for writing the ECMAScript specification, have done a great job progressively enhancing the JavaScript language. This, and the fact that JavaScript is so flexible, allows us to use so-called polyfills and shims to make our code run in older browsers.

ECMAScript 6 (also referred to as ECMAScript 2015) was published in June 2015, exactly four years after its predecessor. There is a massive amount of new API additions as well as a whole bunch of new language features. The language features are syntactic sugar, and ECMAScript 6 can be transpiled to its previous version where it runs perfectly in older browsers. At the time of writing this book, none of the current browser versions have fully implemented ECMAScript 6, but there's absolutely no reason not to use it for production applications.

Syntactic sugar is a design approach where we evolve a programming language without breaking backwards compatibility. This allows language designers to come up with new syntax, which enriches developer experience but does not break the web. Every new feature needs to be translatable to the old syntax. This way, so-called transpilers can be used to convert code to older versions.
主站蜘蛛池模板: 廊坊市| 红河县| 成安县| 乐安县| 南陵县| 沂源县| 罗源县| 兴和县| 合阳县| 大足县| 眉山市| 汽车| 台山市| 瑞安市| 英超| 资阳市| 海安县| 金坛市| 石渠县| 青铜峡市| 张家界市| 五常市| 田林县| 香河县| 南平市| 蒙城县| 腾冲县| 石柱| 潍坊市| 施秉县| 克东县| 清流县| 田阳县| 和平县| 乐昌市| 平武县| 杂多县| 朔州市| 永吉县| 林西县| 山阴县|