zzz6519003 / blog

My blog about coding
4 stars 1 forks source link

魔咒:很小的、递归的自动柯里化 #140

Open zzz6519003 opened 4 years ago

zzz6519003 commented 4 years ago
// 很小的、递归的自动柯里化
const curry = (
  f, arr = []
) => (...args) => (
  a => a.length === f.length ?
    f(...a) :
    curry(f, a)
)([...arr, ...args]);
zzz6519003 commented 4 years ago

@dsh0416