Skip to content

Instantly share code, notes, and snippets.

@rahulbanerjee26
Created July 6, 2022 04:07
Show Gist options
  • Save rahulbanerjee26/d4585695249b3d9e88860520d787ec69 to your computer and use it in GitHub Desktop.
Save rahulbanerjee26/d4585695249b3d9e88860520d787ec69 to your computer and use it in GitHub Desktop.
const myFunc = (greetings,name) => `${greetings()}, ${name}! `;
const hello = () => "Hello"
const bonjour = () => "Bonjour"
const salut = () => "Salut"
const result_1 = myFunc(hello,"Rahul");
const result_2 = myFunc(bonjour,"Rahul");
const result_3 = myFunc(salut,"Rahul");
console.log(result_1);
console.log(result_2);
console.log(result_3);
// Output:
// Hello, Rahul!
// Bonjour, Rahul!
// Salut, Rahul!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment