Skip to content

Instantly share code, notes, and snippets.

@mattbierner
Created September 23, 2012 01:25
Show Gist options
  • Save mattbierner/3768458 to your computer and use it in GitHub Desktop.
Save mattbierner/3768458 to your computer and use it in GitHub Desktop.
Callable.js example
// 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