es6 function <T> 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 class example
class Polygon {
constructor(height, width) {
this.height = height;
this.width = width;
}
}