Skip to content

Instantly share code, notes, and snippets.

@dwelch2344
Created November 12, 2012 21:20
Show Gist options
  • Save dwelch2344/4061976 to your computer and use it in GitHub Desktop.
Save dwelch2344/4061976 to your computer and use it in GitHub Desktop.
Apply test
function f(){ console.log(arguments.length, " => ", arguments); }
f()
// 0 " => " []
f('a', 'b')
// 2 " => " ["a", "b"]
f(['a', 'b', 'c'])
// 1 " => " [ Array[3] ]
f.apply(this, ['a', 'b', 'c'])
// 3 " => " ["a", "b", "c"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment