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

Modern JavaScript

Before we get into Node.js and writing code in Koa, we should take a quick look at the modern JavaScript ES6, ES7 (and beyond) syntaxes and the advantages they bring. ES6 (or ES 2015) and ES7 (or ES 2016) are major updates to the JavaScript language that brought a lot of new features and optimized the language for readability and simplicity.

Some of the key features introduced by ES6 include let, const, object destructuring, the spread operator, and so on. The async... await syntax, which is heavily used by Koa, is a new feature introduced in ES7. Some other key features introduced by ES7 are destructuring assignment (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) and Observables (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe). Beyond ES6 and Es7, a lot of new features are continually being implemented in JavaScript. Embracing these new features helps to keep up with the best practices and constantly improve the quality of the code we write.

The introduction of modern syntaxes and functions have made it possible for JavaScript developers to write concise and maintainable code, without the need to sacrifice performance. On the contrary, a lot of the new features make it possible to do more things in the language. Some of these things were done in the past using external libraries that exposed helper functions. Examples of such libraries include Lodash and Underscore.js.

Most code examples in this book use the newer ES6/ES7 JavaScript features. Ensure you have a recent version of JavaScript running on your machine so as to be able to follow along adequately.

主站蜘蛛池模板: 无棣县| 沅陵县| 运城市| 翼城县| 阿鲁科尔沁旗| 会昌县| 台中县| 武宁县| 榆树市| 城市| 阳春市| 东山县| 离岛区| 莲花县| 炎陵县| 鄂尔多斯市| 泾阳县| 天柱县| 临西县| 蒙自县| 贵阳市| 岱山县| 大荔县| 盈江县| 吕梁市| 蓝山县| 大同县| 中方县| 旬阳县| 临潭县| 宣化县| 双流县| 宜宾县| 永平县| 宝丰县| 岳西县| 双鸭山市| 巩义市| 廊坊市| 卓尼县| 丰顺县|