ES6 or ES2015, JavaScript new way of doing things. LET is the new VAR. Arrow Function. Default Parameter. Const declaration. Shorthand Properties. Object Enhancements. Spread Operator. Template Literal. Destructuring. Promises
5. FUNCTION PARAMETER DEFAULT VALUE
Old Way
• Test the parameter to ‘undefined’
at the body function, and then
assign value if ‘undefined’.
ES6 New Way
• Simply put parameter default value
in the function head.
6. CONST DECLARATION
Old Way
• Using upper case to declare
variable which the value will
remain constant. But this actually
did not prevent the variable to re-
assign new value.
ES6 New Way
• CONST declaration to create
read-only reference to a value.
7. SHORTHAND PROPERTIES
Old Way ES6 New Way
• Easily construct object with
property that you already have.
(backward destructuring)
11. PROMISES
Old Way
• Callback hell
ES6 NewWay
• Promises object represents the
eventual completion (or failure) of
an asynchronous operation,and its
resulting value