1//If body has single statement
2let myFunction = (arg1, arg2, ...argN) => expression
3
4//for multiple statement
5let myFunction = (arg1, arg2, ...argN) => {
6 statement(s)
7}
8//example
9let hello = (arg1,arg2) => "Hello " + arg1 + " Welcome To "+ arg2;
10console.log(hello("User","Grepper"))
11//Start checking js code on chrome inspect option
1const power = (base, exponent) => {
2 let result = 1;
3 for (let count = 0; count < exponent; count++) {
4 result *= base;
5 }
6 return result;
7 };
1let numbers = (x, y, z) => (x + y + z) * 2;
2console.log(numbers(3, 5, 9))
3//Expected output:34