Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

ES6 - Arrow functions

0 votes
52 views
added Apr 8 in ES6 by LC Marshal Captain (25,840 points)
//Arrow function in ES6 simplify the JS function without (function), return and brackets

// ES5
var x = function(x, y) {
   return x * y;
}

// ES6
const x = (x, y) => x * y;

 

1 Response

0 votes
responded Apr 23 by lcjr Second Warrant Officer (3,200 points)
let NewParameters = (a, b) => {
 console.log(a+b); // 30
}
NewParameters(10, 20);

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...