Skip to content

Instantly share code, notes, and snippets.

@johnantoni
Created July 7, 2015 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnantoni/a409b682f0abe46391ea to your computer and use it in GitHub Desktop.
Save johnantoni/a409b682f0abe46391ea to your computer and use it in GitHub Desktop.
javascript function types
// self invoking
(function () {
var x = "Hello!!"; // I will invoke myself
})();
// functions as values
function myFunction(a, b) {
return a * b;
}
var x = myFunction(4, 3);
// functions as objects
function myFunction(a, b) {
return a * b;
}
var txt = myFunction.toString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment