MCPcopy
hub / github.com/getify/Functional-Light-JS / curry

Function curry

ch11-code/fp-helpers.js:60–73  ·  view source on GitHub ↗
(fn,arity = fn.length)

Source from the content-addressed store, hash-verified

58}
59
60function curry(fn,arity = fn.length) {
61 return (function nextCurried(prevArgs){
62 return function curried(nextArg){
63 var args = [ ...prevArgs, nextArg ];
64
65 if (args.length >= arity) {
66 return fn( ...args );
67 }
68 else {
69 return nextCurried( args );
70 }
71 };
72 })( [] );
73}
74
75function uncurry(fn) {
76 return function uncurried(...args){

Callers 6

fp-helpers.jsFile · 0.85
unboundMethodFunction · 0.85
updateStockElemsFunction · 0.85
updateStockFunction · 0.85
stock-ticker.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected