Created
July 5, 2013 15:51
-
-
Save imbcmdth/5935440 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var slice = Array.prototype.slice; | |
var call = Function.prototype.call; | |
var toArray = function () { return call.apply(slice, arguments); } | |
// Usage: | |
toArray(arguments); //=> make an array from all arguments | |
toArray(arguments, 1, 3); //=> make an array from arguments[1] to arguments[2] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment