Skip to content

Instantly share code, notes, and snippets.

@Maccauhuru
Created January 16, 2019 01:23
Show Gist options
  • Save Maccauhuru/b9ea6256eec8a80e4657f5f3ec82d266 to your computer and use it in GitHub Desktop.
Save Maccauhuru/b9ea6256eec8a80e4657f5f3ec82d266 to your computer and use it in GitHub Desktop.
Example Of Anonymous Function
//An anonymous function expression that accepts a single parameter (username)
const printName = function (username){
return "Your name is : " + username;
}
//To invoke the function,i will call printName and give it a parameter e.g "Simba"
// or "David" or "Mary" etc , try it and use your own name!
printName("Simba"); // will output : "Your name is : Simba"
printName("David"); // will output : "Your name is : David"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment