const greeting = (name = "Anonymous") => "Hello " + name;
console.log(greeting("John"));
console.log(greeting());
let greet = x => console.log(x);
greet('Hello'); // Hello
let greet = () => console.log('Hello');
greet(); // Hello
function show() {
return x => x + arguments[0];
}
let display = show(10, 20);
let result = display(5);
console.log(result); // 15
Code language: JavaScript (javascript)