Javascript examples for Function:Arrow Function
Arrow operator to create function
//Vanilla JS//from w ww . j a v a2 s . c o m function squareVanilla(x) { return x * x; } let squareES6 = x => x * x; // 6. let squareAnonymous = function (x) { return x * x; } console.log(`Using Vanilla JS: ${squareVanilla(5)}`); console.log(`Using ES6: ${squareES6(5)}`); console.log(`Using Anonymous: ${squareAnonymous(5)}`);