Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var functionName = function(variable)
- {
- // code code code
- // code code code
- // (more lines of code)
- };
- // calling the function
- functionName(variable);
- -------------------------------------------------------------------------------------------------------------------------------
- EXAMPLE #1
- var foodDemand = function (food)
- {
- console.log("I want to eat" + " " + food + ".");
- };
- foodDemand("carrots");
- OUTPUT:
- I want to eat carrots.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement