Skip to content

Instantly share code, notes, and snippets.

@fitzgen
Created June 10, 2010 19:01
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 fitzgen/433469 to your computer and use it in GitHub Desktop.
Save fitzgen/433469 to your computer and use it in GitHub Desktop.
> (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