Advance Js - Arrow Functions



Before

 
let welcome = function(name){
   return `Welcome ${name}`;
}

console.log(welcome("Yahoo Baba"));


With Arrow Function

 
let welcome = (name) => {
   return `Welcome ${name}`;
}

console.log(welcome("Yahoo Baba"));


Arrow Function with Multiple Parameters

 
let welcome = (name,age) => {
 return `Welcome ${name} ${age}`;
}
	
console.log(welcome("Yahoo Baba", 30));