4 ms·
Here's what I use: # Adapted from http://autotelicum.github.com/Smooth-CoffeeScript/literate/partial.html F.partial = (func, a...) -> (b...) -> func (f
by bdr 14y ago
Here's what I use:
# Adapted from http://autotelicum.github.com/Smooth-CoffeeScript/literate/partial.html
F.partial = (func, a...) -> (b...) ->
func (for arg in a then arg ?= b.shift())..., b...
For example, do `parseInt10 = F.partial(parseInt, undefined, 10)`, then `[].map(parseInt10)` does the right thing.