Skip to content

Instantly share code, notes, and snippets.

@Fishrock123
Last active December 21, 2015 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fishrock123/98c35a0c745cb59d7496 to your computer and use it in GitHub Desktop.
Save Fishrock123/98c35a0c745cb59d7496 to your computer and use it in GitHub Desktop.
// should do the same as
// var args = Array.prototype.slice.call(arguments)
// without leaking arguments
var i = arguments.length
var args = new Array(i)
while (i-- !== 0) args[i] = arguments[i]
// should do the same as
// var args = Array.prototype.slice.call(arguments, 3);
// without leaking arguments
var i = arguments.length - 3
var args = []
if (i > 0) {
args.length = i
while (i-- !==0) args[i] = arguments[i + 3]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment