您能解释一下此JavaScript代码的含义吗?

时间:2019-01-31 11:23:39

标签: javascript

您能告诉我这段JavaScript代码是什么意思吗?

const TRUE = x => y => x;
const FALSE = x => y => y;
const IFELSE = p => a => b => p(a)(b);

console.log(IFELSE(TRUE)('1')('2'));  // The result is: 1
console.log(IFELSE(FALSE)('1')('2')); // The result is: 2

0 个答案:

没有答案