Skip to content

Instantly share code, notes, and snippets.

@emkay
Created November 14, 2011 02:13
Show Gist options
  • Select an option

  • Save emkay/1363076 to your computer and use it in GitHub Desktop.

Select an option

Save emkay/1363076 to your computer and use it in GitHub Desktop.
Function Examples
// add
var add = function (a, b) {
return a + b;
};
// or
function add (a, b) {
return a + b;
}
// invoke
add(5, 5); // returns 10
// double
var double = function (a) {
return a * 2;
};
// or
function double (a) {
return a * 2;
}
//invoke
double(7); // returns 14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment