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

What's ES2017?

One of the main changes to this book since its first edition is the emphasis on modern JavaScript; in this case, ES2017. Formerly known as ES6 (Harmony), it pushes the language features of JavaScript forward significantly, allowing for new usage patterns that simplify code readability and increased expressiveness. If you've written JavaScript before and the examples in this chapter look pretty confusing, it means you're probably familiar with the older, more common ES5 syntax.However, don't sweat! It really doesn't take too long to get the hang of the new syntax, and I will try to explain the new language features as we encounter them. Although it might seem to be something of a steep learning curve at the start, by the end, you'll have improved your ability to write code quite substantially and will be on the cutting edge of contemporary JavaScript development.

For a really good rundown of all the new toys you have with ES2015-17, check out  https://babeljs.io/docs/learn-es2015/, a nice guide by the folks at Babel.js, which we will use extensively throughout this book. 

Before I go any further, let me clear some confusion about what ES2017 actually is. Initially, the ECMAScript (or ES for short) standards were incremented by cardinal numbers, for instance, ES4, ES5, ES6, and ES7. However, with ES6, they changed this so that a new standard is released every year in order to keep pace with modern development trends, and thus we refer to the year (2017) now. The big release was ES2015, which more or less maps to ES6. ES2016 was ratified in June 2016, and builds on the previous year's standard, while adding a few fixes and two new features. ES2017 is currently in the draft stage, which means proposals for new features are being considered and developed until it is ratified sometime in 2017. As a result of this book being written while these features were in draft, they may not actually make it to ES2017 and thus may need to wait until a later standard to be officially added to the language.

You don't really need to worry about any of this, however, because we use Babel.js to transpile everything down to ES5 anyway, so it runs the same in Node.js and in the browser. I will try to refer to the relevant specification where a feature is added, when I introduce it for the sake of accuracy (for instance, modules are an ES2015 feature), but when I refer to JavaScript, I mean all modern JavaScript, regardless of which ECMAScript specification it originated in.

主站蜘蛛池模板: 郸城县| 南岸区| 武义县| 潮州市| 广南县| 天津市| 铜鼓县| 玛纳斯县| 固安县| 常宁市| 佛学| 高密市| 达州市| 陕西省| 丁青县| 连南| 遂川县| 济源市| 兴国县| 浦北县| 红原县| 广安市| 民县| 监利县| 溧阳市| 建德市| 汾西县| 格尔木市| 泸西县| 徐闻县| 昌黎县| 望谟县| 绥化市| 天峻县| 纳雍县| 大安市| 镇康县| 宝丰县| 东乡族自治县| 专栏| 广饶县|