ECMAScript (ES) is a scripting language specification standardized by ECMAScript International. It is used by applications to enable client-side scripting. Languages like JavaScript, Jscript and ActionScript are governed by this specification. This tutorial introduces you to ES6 implementation in JavaScript.
Constants
Support for constants (also known as “immutable variables”), i.e., variables which cannot be re-assigned new content. Notice: this only makes the variable itself immutable, not its assigned content (for instance, in case the content is an object, this means the object itself can still be altered).
Scoping
Block-scoped variables (and constants) without hoisting.
Block-scoped function definitions.
Arrow Functions
Expression Bodies
More expressive closure syntax.
Statement Bodies
More expressive closure syntax.
Lexical this
More intuitive handling of current object context.
Extended Parameter Handling
Default Parameter Values
Simple and intuitive default values for function parameters.
Rest Parameter
Aggregation of remaining arguments into single parameter of variadic functions.
Spread Operator
Spreading of elements of an iterable collection (like an array or even a string) into both literal elements and individual function parameters.
Template Literals
String Interpolation
Intuitive expression interpolation for single-line and multi-line strings. (Notice: don’t be confused, Template Literals were originally named “Template Strings” in the drafts of the ECMAScript 6 language specification)
Custom Interpolation
Flexible expression interpolation for arbitrary methods.
Raw String Access
Access the raw template string content (backslashes are not interpreted).
Extended Literals
Binary & Octal Literal
Direct support for safe binary and octal literals.
Unicode String & RegExp Literal
Extended support using Unicode within strings and regular expressions.
Enhanced Regular Expression
Regular Expression Sticky Matching
Keep the matching position sticky between matches and this way support efficient parsing of arbitrary long input strings, even with an arbitrary number of distinct regular expressions.
Enhanced Object Properties
Property Shorthand
Shorter syntax for common object property definition idiom.
Computed Property Names
Support for computed names in object property definitions.
Method Properties
Support for method notation in object property definitions, for both regular functions and generator functions.
Destructuring Assignment
Array Matching
Intuitive and flexible destructuring of Arrays into individual variables during assignment.
Object Matching, Shorthand Notation
Intuitive and flexible destructuring of Objects into individual variables during assignment.
Object Matching, Deep Matching
Intuitive and flexible destructuring of Objects into individual variables during assignment.
Object And Array Matching, Default Values
Simple and intuitive default values for destructuring of Objects and Arrays.
Parameter Context Matching
Intuitive and flexible destructuring of Arrays and Objects into individual parameters during function calls.
Fail-Soft Destructuring
Fail-soft destructuring, optionally with defaults.
Modules
Value Export/Import
Support for exporting/importing values from/to modules without global namespace pollution.
Default & Wildcard
Marking a value as the default exported value and mass-mixin of values.
Classes
Class Definition
More intuitive, OOP-style and boilerplate-free classes.
Class Inheritance
More intuitive, OOP-style and boilerplate-free inheritance.
Class Inheritance, From Expressions
Support for mixin-style inheritance by extending from expressions yielding function objects. [Notice: the generic aggregation function is usually provided by a library like this one, of course]
Base Class Access
Intuitive access to base class constructor and methods.
Static Members
Simple support for static class members.
Getter/Setter
Getter/Setter also directly within classes (and not just within object initializers, as it is possible since ECMAScript 5.1).
Symbol Type
Symbol Type
Unique and immutable data type to be used as an identifier for object properties. Symbol can have an optional description, but for debugging purposes only.
Global Symbols
Global symbols, indexed through unique keys.
Iterators
Iterator & For-Of Operator
Support “iterable” protocol to allow objects to customize their iteration behaviour. Additionally, support “iterator” protocol to produce sequence of values (either finite or infinite). Finally, provide convenient of operator to iterate over all values of an iterable object.
Generators
Generator Function, Iterator Protocol
Support for generators, a special case of Iterators containing a generator function, where the control flow can be paused and resumed, in order to produce sequence of values (either finite or infinite).
Generator Function, Direct Use
Support for generator functions, a special variant of functions where the control flow can be paused and resumed, in order to produce sequence of values (either finite or infinite).
Generator Matching
Support for generator functions, i.e., functions where the control flow can be paused and resumed, in order to produce and spread sequence of values (either finite or infinite).
Generator Control-Flow
Support for generators, a special case of Iterators where the control flow can be paused and resumed, in order to support asynchronous programming in the style of “co-routines” in combination with Promises (see below). [Notice: the generic async function usually is provided by a reusable library and given here just for better understanding. See co or Bluebird’s coroutine in practice.]
Generator Methods
Support for generator methods, i.e., methods in classes and on objects, based on generator function
Map/Set & WeakMap/WeakSet
Set Data-Structure
Cleaner data-structure for common algorithms based on set
Map Data-Structure
Cleaner data-structure for common algorithms based on maps.
Support for arbitrary byte-based data structures to implement network protocols, cryptography algorithms, file format manipulations, etc.
New Built-In Methods
Object Property Assignment
New function for assigning enumerable properties of one or more source objects onto a destination object.
Array Element Finding
New function for finding an element in an array.
String Repeating
New string repeating functionality.
String Searching
New specific string functions to search for a sub-string.
Number Type Checking
New functions for checking for non-numbers and finite numbers.
Number Safety Checking
Checking whether an integer number is in the safe range, i.e., it is correctly represented by JavaScript (where all numbers, including integer numbers, are technically floating point number).
Number Comparison
Availability of a standard Epsilon value for more precise comparison of floating point numbers.
Number Truncation
Truncate a floating point number to its integral part, completely dropping the fractional part.
Number Sign Determination
Determine the sign of a number, including special cases of signed zero and non-number.
Promises
Promise Usage
First class representation of a value that may be made asynchronously and be available in the future.
Promise Combination
Combine one or more promises into new promises without having to take care of ordering of the underlying asynchronous operations yourself.
Meta-Programming
Proxying
Hooking into runtime-level object meta-operations.
Reflection
Make calls corresponding to the object meta-operations.
Internationalization & Localization
Collation
Number Formatting
Format numbers with digit grouping and localized separators.
Currency Formatting
Format numbers with digit grouping, localized separators and attached currency symbol.
Date/Time Formatting
Format date/time with localized ordering and separators.