Created
April 6, 2014 02:17
-
-
Save hillarymelville/10000687 to your computer and use it in GitHub Desktop.
Different ways to do the same thing
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
function funny(p) { | |
return p; | |
} | |
var funny = function (p) { | |
return p; | |
} | |
var funny = function wry(p) { | |
return p; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not quite the same thing.
The difference is in how they're hoisted, and what the
name
field is.See https://gist.github.com/isaacs/10168967. Also threw in
new Function(..)
to highlight how that one runs in the global scope instead of where it's defined.