Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Practical ES6
Notice of Rights
Notice of Liability
Trademark Notice
About SitePoint
Preface
Who Should Read This Book?
Conventions Used
Code Samples
Tips, Notes, and Warnings
Chapter 1: New Keywords: let and const
by Aurelio de Rosa
let
const
Conclusion
Chapter 2: Using Map, Set, WeakMap, WeakSet
by Kyle Pennell
Searching for the JavaScript HashMap
Downside #1: Keys must be strings in ES5
Downside #2: Objects are not inherently iterable
Downside #3: Challenges with built-in method collisions
Using ES6 Map Collections
Creating a map and using common methods
Using the Set Collection
Weak Collections, Memory, and Garbage Collections
WeakMap
Use cases
Private data use case
DOM nodes use case
WeakSet
Map All Things? Records vs ES6 Collections
New ES6 Collections Yield a More Usable JavaScript
Chapter 3: New Array.* and Array.prototype.* Methods
by Aurelio De Rosa
Array.from()
Array.prototype.find()
Array.prototype.findIndex()
Array.prototype.keys()
Array.prototype.values()
Array.prototype.fill()
Conclusion
Chapter 4: New String Methods — String.prototype.*
by Aurelio de Rosa
String.prototype.startsWith()
String.prototype.endsWith()
String.prototype.includes()
String.prototype.repeat()
String.raw()
Conclusion
Chapter 5: New Number Methods
by Aurelio de Rosa
Number.isInteger()
Number.isNaN()
Number.isFinite()
Number.isSafeInteger()
Number.parseInt() and Number.parseFloat()
ES6 Number Methods: Wrapping Up
Chapter 6: ES6 Arrow Functions: Fat and Concise Syntax in JavaScript
by Kyle Pennell
What Are Arrow Functions?
Using Arrow Functions
Basic Syntax with Multiple Parameters (from MDN)
Basic Syntax with One Parameter
No Parameters
Object Literal Syntax
Use Cases for Arrow Functions
Promises and Callbacks
Gotchas and Pitfalls of Arrow Functions
More about this
Constructors
Generators
Arguments object
How Much Use Is There for Arrow Functions?
Chapter 7: Symbols and Their Uses
by Nilson Jacques
Creating New Symbols
What Can I Do With Symbols?
Well-known Symbols
The Global Registry
Use Cases
Browser Support
Conclusion
Chapter 8: How to Use Proxies
by Craig Buckler
Proxy Trap Types
Proxy Example 1: Profiling
Proxy Example 2: Two-way Data Binding
Further Examples
Proxy Support
Chapter 9: Destructuring Assignment
by Craig Buckler
Easier Declaration
Variable Value Swapping
Default Function Parameters
Returning Multiple Values from a Function
For-of Iteration
Regular Expression Handling
Destructuring Assignment Support
Chapter 10: ES6 Generators and Iterators: a Developer’s Guide
by Byron Houwens
Iterators
Generators
Cool, so Can I Use Generators and Iterators Now?
Conclusions
Chapter 11: Object-oriented JavaScript: A Deep Dive into ES6 Classes
by Jeff Mott
Constructors
Keep Data Private
Privacy with Conventions
Privacy with Privileged Methods
Privacy with Symbols
Privacy with Weak Maps
Other Access Modifiers
Referring to the Current Object
Static Properties and Methods
Subclasses
Inherit to Avoid Duplication
IS-A and WORKS-LIKE-A
Beware Overuse
Inherit to Substitute Subclasses
More than Sugar
Static Properties Are Inherited
Built-in Constructors Can Be Subclassed
Miscellaneous
Using New Features in Imaginative Ways
Multiple Inheritance with Proxies
Multiple Inheritance with Class Factories
Conclusion
Chapter 12: Understanding ES6 Modules
by Craig Buckler
Where are Modules in JavaScript?
Multiple HTML <script> Tags
Script Concatenation
Module Loaders
Module Bundlers, Preprocessors and Transpilers
ES6 Modules
Using ES6 Modules in Browsers
Server Considerations
Module Execution is Deferred
Module Fallbacks
Should You Use Modules in the Browser?
Using ES6 Modules in Node.js
Should You Use ES6 Modules in Node.js?
Module Melee
Chapter 13: An Overview of JavaScript Promises
by Sandeep Panda
Overview
The API
Chaining Promises
Handling Errors
Conclusion
Chapter 14: JavaScript Decorators: What They Are and When to Use Them
by Graham Cox
What is a Decorator?
How to Use JavaScript Decorators
Why Use Decorators?
Different Types of Decorator
Class member decorators
Class decorators
Real World Examples
Core decorators
React
MobX
Summary
Chapter 15: Enhanced Object Literals
by Craig Buckler
Object Initialization From Variables
Object Method Definition Shorthand
Dynamic Property Keys
Destructuring (Variables From Object Properties)
Default Function Parameters
Parsing Returned Objects
ES2018 (ES9) Rest/Spread Properties
Chapter 16: Introduction to the Fetch API
by Ludovico Fischer
The Fetch API
Loading JSON
Async … await
Handling Errors
Change the Request Method and Headers
Bringing it all Together
Where to Go from Here
Chapter 17: ES6 (ES2015) and Beyond: Understanding JavaScript Versioning
by James Wright
The Early History of JavaScript Versioning
The Birth of ECMAScript
ECMAScript 2015 and the Resurgence of Yearly Releases
The TC39 Process
Stage 0: Strawman
Stage 1: Proposal
Stage 2: Draft
Stage 3: Candidate
Stage 4: Finished
Moving Forward
ES2016
ES2017
ES2018
A Final Word
Chapter 18: What’s New in ES2017: Async Functions, Improved Objects, and More
by Craig Buckler
The Update Process
What's New in ES2017
Async functions
Object.values()
Object.entries()
Object.getOwnPropertyDescriptors()
padStart() and padEnd() String Padding
Trailing Commas are Permitted
SharedArrayBuffer and Atomics
Chapter 19: What’s New in ES2018
by Craig Buckler
ES2016
ES2017
ES2018
Asynchronous Iteration
Promise.finally()
Rest/Spread Properties
Regular Expression Named Capture Groups
Regular Expression lookbehind Assertions
Regular Expression s (dotAll) Flag
Regular Expression Unicode Property Escapes
Template Literals Tweak
← Prev
Back
Next →
← Prev
Back
Next →