Exploring ES6
Exploring ES6
Upgrade to the next version of JavaScript
About the Book
- Complete contents of this book: http://exploringjs.com/es6/
- Homepage with various resources: http://exploringjs.com/es6.html
Bundles that include this book
Table of Contents
-
-
What you need to know about this book
- Audience: JavaScript programmers
- Why should I read this book?
- How to read this book
- Sources of this book
- Glossary
- Conventions
- Demo code on GitHub
- Sidebars
- Footnotes
- Foreword
- Preface
- Acknowledgements
- About the author
-
What you need to know about this book
-
I Background
-
1. About ECMAScript 6 (ES6)
- 1.1 TC39 (Ecma Technical Committee 39)
- 1.2 How ECMAScript 6 was designed
- 1.3 JavaScript versus ECMAScript
- 1.4 Upgrading to ES6
- 1.5 Goals for ES6
- 1.6 Categories of ES6 features
- 1.7 A brief history of ECMAScript
-
2. FAQ: ECMAScript 6
- 2.1 How can I use ES6 today?
- 2.2 Isn’t ECMAScript 6 now called ECMAScript 2015?
- 2.3 How do I migrate my ECMAScript 5 code to ECMAScript 6?
- 2.4 Does it still make sense to learn ECMAScript 5?
- 2.5 Is ES6 bloated?
- 2.6 Isn’t the ES6 specification very big?
- 2.7 Does ES6 have array comprehensions?
- 2.8 Is ES6 statically typed?
-
3. One JavaScript: avoiding versioning in ECMAScript 6
- 3.1 Versioning
- 3.2 Strict mode and ECMAScript 6
- 3.3 Breaking changes in ES6
- 3.4 Conclusion
- 3.5 Further reading
-
4. Core ES6 features
-
4.1 From
var
toconst
/let
- 4.2 From IIFEs to blocks
- 4.3 From concatenating strings to template literals
- 4.4 From function expressions to arrow functions
- 4.5 Handling multiple return values
-
4.6 From
for
toforEach()
tofor-of
- 4.7 Handling parameter default values
- 4.8 Handling named parameters
-
4.9 From
arguments
to rest parameters -
4.10 From
apply()
to the spread operator (...
) -
4.11 From
concat()
to the spread operator (...
) - 4.12 From function expressions in object literals to method definitions
- 4.13 From constructors to classes
-
4.14 From custom error constructors to subclasses of
Error
- 4.15 From objects to Maps
- 4.16 New string methods
- 4.17 New Array methods
- 4.18 From CommonJS modules to ES6 modules
- 4.19 What to do next
-
4.1 From
-
1. About ECMAScript 6 (ES6)
-
II Data
-
5. New number and
Math
features- 5.1 Overview
- 5.2 New integer literals
-
5.3 New static
Number
properties -
5.4 New
Math
functionality - 5.5 FAQ: numbers
-
6. New string features
- 6.1 Overview
- 6.2 Unicode code point escapes
- 6.3 String interpolation, multi-line string literals and raw string literals
- 6.4 Iterating over strings
- 6.5 Numeric values of code points
- 6.6 Checking for inclusion
- 6.7 Repeating strings
- 6.8 String methods that delegate regular expression work to their parameters
- 6.9 Reference: the new string methods
-
7. Symbols
- 7.1 Overview
- 7.2 A new primitive type
- 7.3 Using symbols to represent concepts
- 7.4 Symbols as keys of properties
- 7.5 Converting symbols to other primitive types
- 7.6 Wrapper objects for symbols
- 7.7 Crossing realms with symbols
- 7.8 FAQ: symbols
-
7.9 The spelling of well-known symbols: why
Symbol.iterator
and notSymbol.ITERATOR
(etc.)? - 7.10 The symbol API
-
8. Template literals
- 8.1 Overview
- 8.2 Introduction
- 8.3 Examples of using tagged template literals
- 8.4 Implementing tag functions
- 8.5 FAQ: template literals and tagged template literals
-
9. Variables and scoping
- 9.1 Overview
-
9.2 Block scoping via
let
andconst
-
9.3
const
creates immutable variables - 9.4 The temporal dead zone
-
9.5
let
andconst
in loop heads - 9.6 Parameters as variables
- 9.7 The global object
- 9.8 Function declarations and class declarations
-
9.9 Coding style:
const
versuslet
versusvar
-
10. Destructuring
- 10.1 Overview
- 10.2 Background: Constructing data versus extracting data
- 10.3 Patterns for destructuring
- 10.4 How do patterns access the innards of values?
- 10.5 Default values
- 10.6 More object destructuring features
- 10.7 More Array destructuring features
- 10.8 You can assign to more than just variables
- 10.9 Pitfalls of destructuring
- 10.10 Examples of destructuring
- 10.11 The destructuring algorithm
-
11. Parameter handling
- 11.1 Overview
- 11.2 Parameter handling as destructuring
- 11.3 Parameter default values
- 11.4 Rest parameters
- 11.5 Simulating named parameters
- 11.6 Examples of destructuring in parameter handling
- 11.7 Coding style tips
-
11.8 The spread operator (
...
)
-
5. New number and
-
III Modularity
-
12. Callable entities in ECMAScript 6
- 12.1 Overview
- 12.2 Ways of calling in ES6
- 12.3 Recommendations for using callable entities
- 12.4 ES6 callable entities in detail
- 12.5 Dispatched and direct method calls in ES5 and ES6
-
12.6 The
name
property of functions - 12.7 FAQ: callable entities
-
13. Arrow functions
- 13.1 Overview
-
13.2 Traditional functions are bad non-method functions, due to
this
- 13.3 Arrow function syntax
- 13.4 Lexical variables
- 13.5 Syntax pitfalls
- 13.6 Immediately-invoked arrow functions
-
13.7 Arrow functions versus
bind()
- 13.8 Arrow functions versus normal functions
- 13.9 FAQ: arrow functions
-
14. New OOP features besides classes
- 14.1 Overview
- 14.2 New features of object literals
-
14.3 New methods of
Object
- 14.4 Traversing properties in ES6
- 14.5 Assigning versus defining properties
-
14.6
__proto__
in ECMAScript 6 - 14.7 Enumerability in ECMAScript 6
- 14.8 Customizing basic language operations via well-known symbols
- 14.9 FAQ: object literals
-
15. Classes
- 15.1 Overview
- 15.2 The essentials
- 15.3 Private data for classes
- 15.4 Simple mixins
- 15.5 The details of classes
- 15.6 The details of subclassing
- 15.7 The species pattern
- 15.8 The pros and cons of classes
- 15.9 FAQ: classes
- 15.10 What is next for classes?
- 15.11 Further reading
-
16. Modules
- 16.1 Overview
- 16.2 Modules in JavaScript
- 16.3 The basics of ES6 modules
- 16.4 Importing and exporting in detail
- 16.5 The ECMAScript 6 module loader API
- 16.6 Using ES6 modules in browsers
- 16.7 Details: imports as views on exports
- 16.8 Design goals for ES6 modules
- 16.9 FAQ: modules
- 16.10 Advantages of ECMAScript 6 modules
- 16.11 Further reading
-
12. Callable entities in ECMAScript 6
-
IV Collections
-
17. The
for-of
loop- 17.1 Overview
-
17.2 Introducing the
for-of
loop -
17.3 Pitfall:
for-of
only works with iterable values -
17.4 Iteration variables:
const
declarations versusvar
declarations - 17.5 Iterating with existing variables, object properties and Array elements
- 17.6 Iterating with a destructuring pattern
-
18. New Array features
- 18.1 Overview
-
18.2 New static
Array
methods -
18.3 New
Array.prototype
methods - 18.4 ES6 and holes in Arrays
-
18.5 Configuring which objects are spread by
concat()
(Symbol.isConcatSpreadable
) - 18.6 The numeric range of Array indices
-
19. Maps and Sets
- 19.1 Overview
- 19.2 Map
- 19.3 WeakMap
- 19.4 Set
- 19.5 WeakSet
- 19.6 FAQ: Maps and Sets
-
20. Typed Arrays
- 20.1 Overview
- 20.2 Introduction
- 20.3 ArrayBuffers
- 20.4 Typed Arrays
- 20.5 DataViews
- 20.6 Browser APIs that support Typed Arrays
- 20.7 Extended example: JPEG SOF0 decoder
- 20.8 Availability
-
21. Iterables and iterators
- 21.1 Overview
- 21.2 Iterability
- 21.3 Iterable data sources
- 21.4 Iterating language constructs
- 21.5 Implementing iterables
- 21.6 More examples of iterables
- 21.7 FAQ: iterables and iterators
- 21.8 The ECMAScript 6 iteration protocol in depth
-
22. Generators
- 22.1 Overview
- 22.2 What are generators?
- 22.3 Generators as iterators (data production)
- 22.4 Generators as observers (data consumption)
- 22.5 Generators as coroutines (cooperative multitasking)
- 22.6 Examples of generators
- 22.7 Inheritance within the iteration API (including generators)
- 22.8 Style consideration: whitespace before and after the asterisk
- 22.9 FAQ: generators
- 22.10 Conclusion
- 22.11 Further reading
-
17. The
-
V Standard library
-
23. New regular expression features
- 23.1 Overview
-
23.2 New flag
/y
(sticky) -
23.3 New flag
/u
(unicode) -
23.4 New data property
flags
-
23.5
RegExp()
can be used as a copy constructor - 23.6 String methods that delegate to regular expression methods
-
24. Asynchronous programming (background)
- 24.1 The JavaScript call stack
- 24.2 The browser event loop
- 24.3 Receiving results asynchronously
- 24.4 Looking ahead
- 24.5 Further reading
-
25. Promises for asynchronous programming
- 25.1 Overview
- 25.2 Introduction: Promises
- 25.3 A first example
- 25.4 Three ways of understanding Promises
- 25.5 Creating and using Promises
- 25.6 Examples
- 25.7 Other ways of creating Promises
- 25.8 Chaining Promises
- 25.9 Common Promise chaining mistakes
- 25.10 Tips for error handling
- 25.11 Composing Promises
- 25.12 Two useful additional Promise methods
- 25.13 Node.js: using callback-based sync functions with Promises
- 25.14 ES6-compatible Promise libraries
- 25.15 Next step: using Promises via generators
- 25.16 Promises in depth: a simple implementation
- 25.17 Advantages and limitations of Promises
- 25.18 Reference: the ECMAScript 6 Promise API
- 25.19 Further reading
-
23. New regular expression features
-
VI Miscellaneous
-
26. Unicode in ES6
- 26.1 Unicode is better supported in ES6
- 26.2 Escape sequences in ES6
-
27. Tail call optimization
- 27.1 What is tail call optimization?
- 27.2 Checking whether a function call is in a tail position
- 27.3 Tail-recursive functions
-
28. Metaprogramming with proxies
- 28.1 Overview
- 28.2 Programming versus metaprogramming
- 28.3 Proxies explained
- 28.4 Use cases for proxies
- 28.5 The design of the proxy API
- 28.6 FAQ: proxies
- 28.7 Reference: the proxy API
- 28.8 Conclusion
- 28.9 Further reading
- 29. Coding style tips for ECMAScript 6
-
30. An overview of what’s new in ES6
- 30.1 Categories of ES6 features
-
30.2 New number and
Math
features - 30.3 New string features
- 30.4 Symbols
- 30.5 Template literals
- 30.6 Variables and scoping
- 30.7 Destructuring
- 30.8 Parameter handling
- 30.9 Callable entities in ECMAScript 6
- 30.10 Arrow functions
- 30.11 New OOP features besides classes
- 30.12 Classes
- 30.13 Modules
-
30.14 The
for-of
loop - 30.15 New Array features
- 30.16 Maps and Sets
- 30.17 Typed Arrays
- 30.18 Iterables and iterators
- 30.19 Generators
- 30.20 New regular expression features
- 30.21 Promises for asynchronous programming
- 30.22 Metaprogramming with proxies
-
26. Unicode in ES6
- Notes
The Leanpub 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
80% Royalties. Earn $16 on a $20 book.
We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earned$12,307,240writing, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
OpenIntro Statistics
David Diez, Christopher Barr, Mine Cetinkaya-Rundel, and OpenIntroA complete foundation for Statistics, also serving as a foundation for Data Science.
Leanpub revenue supports OpenIntro (US-based nonprofit) so we can provide free desk copies to teachers interested in using OpenIntro Statistics in the classroom and expand the project to support free textbooks in other subjects.
More resources: openintro.org.
Personal Finance
Jason AndersonThis textbook provides an in-depth analysis on personal finance that is both practical and straightforward in its approach. It has been written in such a way that the readers can gain knowledge without getting overwhelmed by the technical terms. Suitable for both beginners and advanced learners.
Getting to Know IntelliJ IDEA
Trisha Gee and Helen ScottIf we treat our IDE as a text editor, we are doing ourselves a disservice. Using a combination of tutorials and a questions-and-answers approach, Getting to Know IntelliJ IDEA will help you find ways to use IntelliJ IDEA that enable you to work comfortably and productively as a professional developer.
C++20 - The Complete Guide
Nicolai M. JosuttisAll new language and library features of C++20 (for those who know previous C++ versions).
The book presents all new language and library features of C++20. Learn how this impacts day-to-day programming, to benefit in practice, to combine new features, and to avoid all new traps.
Buy early, pay less, free updates.
Other books:
Mastering STM32 - Second Edition
Carmine NovielloWith more than 1200 microcontrollers, STM32 is probably the most complete ARM Cortex-M platform on the market. This book aims to be the most complete guide around introducing the reader to this exciting MCU portfolio from ST Microelectronics and its official CubeHAL and STM32CubeIDE development environment.
R Programming for Data Science
Roger D. PengThis book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
Machine Learning Q and AI
Sebastian Raschka, PhDHave you recently completed a machine learning or deep learning course and wondered what to learn next? With 30 questions and answers on key concepts in machine learning and AI, this book provides bite-sized bits of knowledge for your journey to becoming a machine learning expert.
Stats One
William FooteThe Rails 7 Way
Obie Fernandez, Lucas Dohmen, and Tom Henrik AadlandThe Rails™ 7 Way is the comprehensive, authoritative reference guide for professionals delivering production-quality code using modern Ruby on Rails. It illuminates the entire Rails 7 API, its most powerful idioms, design approaches, and libraries. Building on the previous editions, this edition has been heavily refactored and updated.
Gradual Modularization for Ruby and Rails
Stephan HagemannGet yourself a new tool to manage your Rails application and your growing engineering organization! Prevent the ball-of-mud (and fix it!). Go for microservices or SOA if it makes sense not just because you don't have any other tool. Do all this through a low-overhead tool: packages. Enable better conversations to make practical changes today.
Top Bundles
- #1
Software Architecture
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #2
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification... - #3
1500 QUIZ COMMENTATI (3 libri)
3 Books
Tre libri dei QUIZ MMG Commentati al prezzo di DUE! I QUIZ dei concorsi ufficiali di Medicina Generale relativi agli anni: 2000-2001-2003-2012-2013-2014-2015-2016-2017-2018-2019-2020-2021 +100 inediti Raccolti in unico bundle per aiutarvi nello studio e nella preparazione al concorso. All'interno di ogni libro i quiz sono stati suddivisi per... - #4
Pattern-Oriented Memory Forensics and Malware Detection
2 Books
This training bundle for security engineers and researchers, malware and memory forensics analysts includes two accelerated training courses for Windows memory dump analysis using WinDbg. It is also useful for technical support and escalation engineers who analyze memory dumps from complex software environments and need to check for possible... - #5
Practical FP in Scala + Functional event-driven architecture
2 Books
Practical FP in Scala (A hands-on approach) & Functional event-driven architecture, aka FEDA, (Powered by Scala 3), together as a bundle! The content of PFP in Scala is a requirement to understand FEDA so why not take advantage of this bundle!? - #6
Modern C++ Collection
3 Books
Get All about Modern C++C++ Standard Library, including C++20Concurrency with Modern C++, including C++20C++20Each book has about 200 complete code examples. Updates are included. When I update one of the books, you immediately get the updated bundle. You can expect significant updates to each new C++ standard (C++23, C++26, .. ) and also... - #7
Linux Administration Complet
4 Books
Ce lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité... - #9
Development and Deployment of Multiplayer Online Games, Part ARCH. Architecture (Vol. I-III)
3 Books
What's the Big Idea? The idea behind this book is to summarize the body of knowledge that already exists on multiplayer games but is not available in one single place.And quite a fewof the issues discussed within this series (planned as three nine volumes ~300 pages each), while known in the industry, have not been published at all (except for... - #10
Growing Agile: The Complete Coach's Guide
7 Books
Growing Agile: Coach's Guide Series This bundle provides a collection of training and workshop plans for a variety of agile topics. The series is aimed at agile coaches, trainers and ScrumMasters who often find themselves needing to help teams understand agile concepts. Each book in the series provides the plans, slides, handouts and activity...