javascript箭头函数连写是什么意思?一直不太理解,请大佬说详细一点,代码如下:let CURRENT = 'NULL';const renderAuthorize = Authorized => currentAuthority => { //这一行的箭头函数连写是什么意思?
if (currentAuthority) { if (typeof currentAuthority === 'function') {
CURRENT = currentAuthority();
} if ( Object.prototype.toString.call(currentAuthority) === '[object String]' || Array.isArray(currentAuthority)
) {
CURRENT = currentAuthority;
}
} else {
CURRENT = 'NULL';
} return Authorized;
};export { CURRENT };export default Authorized => renderAuthorize(Authorized);问题就是第2行代码的箭头函数连写,它是什么意思?
1 回答

九州编程
TA贡献1785条经验 获得超4个赞
代表返回值就是函数
例如
const a = b => c=> b + c 写成es5 就是 var a = function(b){ return function(c){ return b + c } }
添加回答
举报
0/150
提交
取消