Currying-in 功能和 ES6 解构

Currying-in function and ES6 destructing

我正在测试一些套用函数,我可以很容易地让它工作:

test = (a) => { return (b) => a+b } // test(5)(6) => 11

使用 ES6 析构参数时,我无法使用相同的函数:

test = ({a}) => { return (b) => a+b } // test(5)(6) => NaN 

有什么办法让它起作用吗?为什么第二个测试功能不起作用?

如果使用解构参数,则必须使用对象调用函数:

test = ({a}) => { return (b) => a+b }
console.log(test({a : 5})(6)); // => 11