mortal-cultivation-biography / daydayup

A FE interview-questions collection repo.
8 stars 0 forks source link

实现柯里化 curry #89

Open nmsn opened 1 year ago

nmsn commented 1 year ago
function curry(fn, ...args) {
  return fn.length <= args.length ? fn(...args) : (...newArgs) => curry(fn, ...args, ...newArgs);
}