Created
January 16, 2019 01:23
-
-
Save Maccauhuru/b9ea6256eec8a80e4657f5f3ec82d266 to your computer and use it in GitHub Desktop.
Example Of Anonymous Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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