Created
September 23, 2012 01:25
-
-
Save mattbierner/3768458 to your computer and use it in GitHub Desktop.
Callable.js example
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
// Call notation | |
var slice = callable.callable(Array.prototype.slice); | |
slice([1, 2, 3, 4], 1, 3) -> [2, 3] | |
// Apply notation | |
var slicea = callable.applicable(Array.prototype.slice); | |
slicea([1, 2, 3, 4], [1, 3]) -> [2, 3] | |
// Call notation binding leading arguments | |
var sliceb = callable.callable(Array.prototype.slice, 1); | |
sliceb([1, 2, 3, 4], 3) -> [2, 3] | |
// Apply notation binding leading arguments | |
var sliceba = callable.applicable(Array.prototype.slice, 1); | |
sliceba([1, 2, 3, 4], [3]) -> [2, 3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment