es6 function defining code example
Example 1: js anonymous function es6
// (param1, param2, paramN) => expression
// ES5
var multiplyES5 = function(x, y) {
return x * y;
};
// ES6
const multiplyES6 = (x, y) => { return x * y };
Example 2: es6 functions
const add = (n1, n2) => n1 + n2