arrow function with arguments code example
Example 1: arrow function rec
(param1, param2, …, paramN) => { statements }
(param1, param2, …, paramN) => expression
(singleParam) => { statements }
singleParam => { statements }
() => { statements }
Example 2: Arrow Functions
const magic = function() {
return new Date();
};
const magic = () => {
return new Date();
};
const magic = () => new Date();
Example 3: arrow function javascript
let myFunction = (arg1, arg2, ...argN) => expression
let myFunction = (arg1, arg2, ...argN) => {
statement(s)
}
let hello = (arg1,arg2) => "Hello " + arg1 + " Welcome To "+ arg2;
console.log(hello("User","Grepper"))