ECMA Script - ES6 Features
Why Should I Learn ES6?
React uses ES6, and you should be familiar with some of the new features like:
Classes
Arrow Functions
Variables (let, const, var)
Array Methods like .map()
Destructuring
Modules
Ternary Operator
Spread Operator
function calc(a,b){
const add = a+b;
const sub = a-b;
const mul = a*b;
const div = a/b;
return [add,sub,mul,div];
}
const [add,sub,mul,div] = calc(2,2);
console.log(calc(2,2));
React uses ES6, and you should be familiar with some of the new features like:
Classes
Arrow Functions
Variables (let, const, var)
Array Methods like .map()
Destructuring
Modules
Ternary Operator
Spread Operator
function calc(a,b){
const add = a+b;
const sub = a-b;
const mul = a*b;
const div = a/b;
return [add,sub,mul,div];
}
const [add,sub,mul,div] = calc(2,2);
console.log(calc(2,2));
Comments
Post a Comment