▶Book Description
Learn ECMAScript explores implementation of the latest ECMAScript features to add to your developer toolbox, helping you to progress to an advanced level. Learn to add 1 to a variable andsafely access shared memory data within multiple threads to avoid race conditions.
You'll start the book by building on your existing knowledge of JavaScript, covering performing arithmetic operations, using arrow functions and dealing with closures. Next, you will grasp the most commonly used ECMAScript skills such as reflection, proxies, and classes. Furthermore, you'll learn modularizing the JS code base, implementing JS on the web and how the modern HTML5 + JS APIs provide power to developers on the web. Finally, you will learn the deeper parts of the language, which include making JavaScript multithreaded with dedicated and shared web workers, memory management, shared memory, and atomics. It doesn't end here; this book is 100% compatible with ES.Next.
By the end of this book, you'll have fully mastered all the features of ECMAScript!
▶What You Will Learn
⦁ Implement methods associated with objects as per the latest ECMAScript specification
⦁ Make use of the latest features of ECMAScript
⦁ Make use of many new APIs in HTML5 and modern JavaScript implementation
⦁ Use SharedArrayBuffers for superfast concurrent and parallel programming
⦁ Perform asynchronous programming with JavaScript
⦁ Implement the best ways and practices to perform modular programming in JavaScript
▶Key Features
⦁ Grasp the latest features of ECMAScript and the best way to use it in production code
⦁ Learn newly added native APIs to JS Engine and perform tasks efficiently with a cleaner code base
⦁ Understand the more complex sides of JavaScript such as the inheritance model, low-level memory management, multithreaded environments, and web workers
▶Who This Book Is For
This book is for anybody who is absolutely new to JavaScript and is willing to learn this technology. This book can also be used by people who are familiar with old JavaScript and want to level up their knowledge to the latest standard and use techniques. For more
advanced users, this book can be used to brush up concepts such as modularity, web workers, and shared memory.
▶What this book covers
⦁ Chapter 1, Getting Started with ECMAScript, discusses what ECMAScript really is and why we call it ECMAScript and not JavaScript. It also discusses how to create variables, perform basic operations, and provides new ways to do those operations in ES8.
⦁ Chapter 2, Knowing Your Library, demonstrates all the functions you need to know as a beginner and intermediate JavaScript developer to work smoothly on various kinds of projects. The functions taught in this chapter are universal and generic functions, which you'll be able to understand and apply anywhere they're necessary for your code.
⦁ Chapter 3, Using Iterators, covers how to iterate over iteratable things in JavaScript the proper way. We discuss Symbol, a new native JavaScript type, what it is, and why we need it. We also discuss the tail call optimization technique, which is implemented by browsers
to speed up the code.
⦁ Chapter 4, Asynchronous Programming, explores modern ways to implement asynchronous programming and compares it with the not-so-beautiful past approaches, which included callback hell. It'll teach you about implementing asynchronous programming in a
synchronous way.
⦁ Chapter 5, Modular Programming, discusses modularizing your JavaScript code into different files so that it is easy to reuse and debug individual modules. We start with primitive and third-party solutions available earlier and then cover the native support
browsers are bringing to the world.
⦁ Chapter 6, Implementing the Reflect API, demonstrates information about the Reflect API provided in JavaScript, which basically helps to manipulate the properties and methods of the objects.
⦁ Chapter 7, Proxies, introduces a new implementation in JavaScript, that is, proxies over objects. It has a number of advantages, such as hiding private properties, setting default values for object properties and methods, and making awesome custom features. Such as Python-like array slicing for JavaScript.
⦁ Chapter 8, Classes, explores classes, how they're implemented, inheritance in classes, and how finally classes is just a syntatic sugar over the function implementation only. This is important because classes make the code more readable and understandable to people
coming from an OOP background.
⦁ Chapter 9, JavaScript on the Web, explores the basics of using JavaScript on websites, some popular APIs exposed by browser on the web to the developers, and how JavaScript can be used to interact with the DOM to manipulate things on a web page.
⦁ Chapter 10, Storage APIs in JavaScript, explores the available storage APIs in web browsers and shows how to make use of them to store data locally on the user's computer.
⦁ Chapter 11, Web and Service Workers, discusses web workers available in HTML5, service workers for progressive web apps, and shows how to use these workers efficiently to distribute loads of tasks.
⦁ Chapter 12, Shared Memory and Atomics, teaches us how to harness a multithreaded environment provided by web workers using shared memory to allow blazingly fast access to memory by the web workers through SharedArrayBuffer. It covers some of the common problems related to threads sharing the same data, and also provides solutions tothose problems.