【发布时间】:2017-12-04 11:06:44
【问题描述】:
有人可以解释一下这种行为吗,还是一个错误?
const firstTest = (a) => console.log(a, 'this will be executed');
const secTest = (a, b) => console.log(a, 'this will not be executed');
const firstIfElse = R.ifElse(R.T, firstTest, () => null);
const unexpectedIfElse = R.ifElse(R.T, secTest, () => null);
firstIfElse('logging appears as expected');
unexpectedIfElse('no logging');
【问题讨论】:
标签: javascript ramda.js