Skip to content

ioslh/tree-thunk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TreeThunk

将多参数函数转成单参数函数

这个我也不知道怎么表述好

var TreeThunk = require('./TreeThunk');

var calc = (a, b, c, d, e, f) => {
  return a + b + c + d - e - f;
}

var thunkCalc0 = TreeThunk(calc, 3);
console.log(thunkCalc0(1, 2)(3, 4)(5, 6));

var thunkCalc1 = TreeThunk(calc, 5);
console.log(thunkCalc1(1, 2)(3)(4)(5)(6));

var thunkCalc2 = TreeThunk(calc, 6);
console.log(thunkCalc2(1)(2)(3)(4)(5)(6));

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages