Created
June 10, 2010 19:01
-
-
Save fitzgen/433469 to your computer and use it in GitHub Desktop.
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 (arg) { return arg === undefined; }()) // Missing arguments are undefined | |
true | |
> var items = [] | |
undefined | |
> items.push() // Pushing implicitly undefined item doesn't work | |
0 | |
> items | |
[] | |
> items.push(undefined) // What about explicitly pushing undefined? | |
1 | |
> items // wtf | |
[undefined] | |
> (function (arg) { return arguments.length; }()) // Ahh, but now it makes sense, still WTF | |
0 | |
> (function (arg) { return arguments.length; }(undefined)) | |
1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment