Created
April 22, 2014 14:29
-
-
Save EragonJ/11181371 to your computer and use it in GitHub Desktop.
example from mdn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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