Skip to content

Instantly share code, notes, and snippets.

@sym3tri
Created November 28, 2012 17:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sym3tri/4162878 to your computer and use it in GitHub Desktop.
Save sym3tri/4162878 to your computer and use it in GitHub Desktop.
JS function behind the scenes
// Every time you define a function it's as if all this happens behind the scenes...
function foo() {
// var arguments = new array-like object corresponding to the function arguments
// foo.length = number of parameters in function definition (different from arguments.length);
// foo.name = 'foo';
// foo.prototype = {};
// foo.constructor = Function;
//// (only if no explicit return statement exists and is not invoked with 'new' operator)
// return undefined;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment