Skip to content

Instantly share code, notes, and snippets.

@nakamura-to
Created February 21, 2012 05:08
Show Gist options
  • Save nakamura-to/1873877 to your computer and use it in GitHub Desktop.
Save nakamura-to/1873877 to your computer and use it in GitHub Desktop.
Function.prototype.call.bind
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/bind
var toArray = Function.prototype.call.bind(Array.prototype.slice);
function f() {
var array = toArray(arguments);
console.log(Array.isArray(array)); // true
}
f(1,2,3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment