ES6 is backward compatible with ES5.
let :- helps in avoiding variable hoisting. Default supports block scoping.
const :- constant variable. usually declared in capital letters. Default supports block scoping.
Block scoping
Array functions :- Similar like lambda. Array function can not change by bind, call functions.
In arrow functions, 'this' is not the function context of the element but the context in which function running.
Default function parameter :- For undefined values, function will use default value.
Rest and Spread:- Rest means gathering all elements together & putting in single array.
... is rest syntax.
... on array object acts as spread i.e. to separate elements
Object literal extensions
for ... of loops
cimpatible
Template Literals :- String template are backword compatibility.
Destructuring :- Taking element from array and assigning to variables. Array & objects can be destructured.
module :- gets executed only once.
import statement gets hoisted & gets executed first.
By default modules are loaded in strict mode.
variables, functions can be exported from module.
exported objects are readonly. But properties of object can be modified.
'import *' exports all variables, functions.
class is function.
let :- helps in avoiding variable hoisting. Default supports block scoping.
const :- constant variable. usually declared in capital letters. Default supports block scoping.
Block scoping
Array functions :- Similar like lambda. Array function can not change by bind, call functions.
In arrow functions, 'this' is not the function context of the element but the context in which function running.
Default function parameter :- For undefined values, function will use default value.
Rest and Spread:- Rest means gathering all elements together & putting in single array.
... is rest syntax.
... on array object acts as spread i.e. to separate elements
Object literal extensions
for ... of loops
cimpatible
Template Literals :- String template are backword compatibility.
Destructuring :- Taking element from array and assigning to variables. Array & objects can be destructured.
module :- gets executed only once.
import statement gets hoisted & gets executed first.
By default modules are loaded in strict mode.
variables, functions can be exported from module.
exported objects are readonly. But properties of object can be modified.
'import *' exports all variables, functions.
class is function.
No comments:
Post a Comment