Skip to content

Instantly share code, notes, and snippets.

@Maccauhuru
Last active January 14, 2019 12:25
Show Gist options
  • Save Maccauhuru/4bb6ff24c98ea507b5b9c86ed5311468 to your computer and use it in GitHub Desktop.
Save Maccauhuru/4bb6ff24c98ea507b5b9c86ed5311468 to your computer and use it in GitHub Desktop.
Function Expression Example
//A simple function expression named userName that accepts username as an input parameter
const userName = function printName(username) {
return "Your name is : " + username;
}
//To invoke the function , i will call its name (userName) and give it a parameter e.g "Simba"
// or "David" or "Mary" etc , try it and use your own name!
userName("Simba"); // will output : "Your name is : Simba"
userName("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