Book Image

Learning ECMAScript 6

By : Narayan Prusty
Book Image

Learning ECMAScript 6

By: Narayan Prusty

Overview of this book

<p>ECMAScript 6 is the new edition to the ECMAScript language, whose specifications are inherited by JavaScript. ES6 gives a vast makeover to JavaScript by adding new syntaxes and APIs to write complex applications and libraries that are easier to debug and maintain. By learning the latest version of ECMAScript, you'll have a greater understanding of JavaScript and more confidence and fluency when developing with it - follow this book and use and adopt ES6 features into your work, instead of the usual tired JavaScript hacks and tricks.</p> <p>The book begins by introducing ECMAScript 6's built-in objects and &nbsp;shows you how to create custom Iterators. &nbsp;It also provides you with guidance on Next, how to write asynchronous code in a synchronous style using ES6, so you can unlock greater control and sophistication in the way you develop with JavaScript.</p> <p>Beyond this, you will also learn&nbsp;how to use Reflect API to inspect and manipulate object properties. Next, it teaches how to create proxies, and use it to intercept and customize operations performed on objects.&nbsp;Finally, it explains old modular programming techniques such as IIFE, CommonJS, AMD, and UMD and also compares it with ECMAScript modules and demonstrates how modules can increase the performance of websites when used.</p>
Table of Contents (16 chapters)

Foreword

There is no better time than now to be working with JavaScript. Over the last few years, we've seen JavaScript go from being the language no one really wanted to touch to being the language that everyone can't wait to get their hands on. Large, complicated applications are being built everyday in browsers and are exercising and pushing JavaScript further than it has ever been pushed before. Frameworks and entirely new approaches to application design have spawned to meet the demands of this new world of client-side development, and the community has rallied around them.

With ECMAScript 2015, or ES6 as it's commonly known, we finally have the language to match our lofty ambitions. We've gained large, much needed functionalities, such as Promises, and a module system that is native to the language; we've also gained smaller, more subtle additions that make day-to-day development more enjoyable. Get familiar with object destructuring, and you'll wonder how you ever wrote JavaScript without it; use an arrow function for the first time, and you'll never want to type "function" again. Avoid the complications of function scope and leaky variables with "let", and you'll spend less time bashing your head against the desk.

Not only is ES6 a great language and an incredible upgrade on ES5, but the hard work of many members of the community also means that you can use it today and not have to wait for complete implementations in browsers. Tools exist to let you convert your ES6 code into ES5 compliant code, meaning the future's now, not 5 years down the line, as it so often is with JavaScript.

This book will guide you through a selection of the most useful additions to JavaScript and bring you up to the speed with the current functionality available to you. You'll learn how building modular applications is much easier with ES6's native module system and how your code can become cleaner, more succinct, and more enjoyable to work with. Learning this new standard is a daunting task for any developer, and I'm delighted to contribute a foreword toward a book that will make this task much less daunting.

This brave new world of JavaScript, client-side applications, frameworks, and more is being powered by ES6, and this book will help you take your first steps toward it. I hope you end this book as excited as I am.

Jack Franklin

JavaScript Developer at GoCardless

@Jack_Franklin

http://www.jackfranklin.co.uk