Array.prototype.slice.call(arguments)
Andrew Burke
91

Normally this is a good idea, except that it causes a decompile in chrome’s V8 because we are “leaking” the arguments object.

Instead, loop over the arguments manually to avoid this.


var args = [];
for (var i = 0; i < arguments.length; i++) {
args.push(arguments[i]);
}
Like what you read? Give Joshua Tenner a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.