Created
November 28, 2012 17:57
-
-
Save sym3tri/4162878 to your computer and use it in GitHub Desktop.
JS function behind the scenes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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