Skip to content

Instantly share code, notes, and snippets.

@Fishrock123
Last active August 29, 2015 14:03
Show Gist options
  • Save Fishrock123/37cc8cd3352e54abec6b to your computer and use it in GitHub Desktop.
Save Fishrock123/37cc8cd3352e54abec6b to your computer and use it in GitHub Desktop.
// Returns a non-leaking, optimizable, safe close of `arguments`
// usage: var args = clone_args.apply(this, arguments)
module.exports = function clone_args() {
var i = arguments.length
var clone = new Array(i)
while (i--) clone[i] = arguments[i]
return clone
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment