Skip to content

Instantly share code, notes, and snippets.

@EragonJ
Created April 22, 2014 14:29
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 EragonJ/11181371 to your computer and use it in GitHub Desktop.
Save EragonJ/11181371 to your computer and use it in GitHub Desktop.
example from mdn
function list() {
return Array.prototype.slice.call(arguments);
}
var list1 = list(1, 2, 3); // [1, 2, 3]
// Create a function with a preset leading argument
var leadingThirtysevenList = list.bind(undefined, 37);
var list2 = leadingThirtysevenList(); // [37]
var list3 = leadingThirtysevenList(1, 2, 3); // [37, 1, 2, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment