js, lambada? 在chrome和node下可以使用
var a=function(a,c){if(a)c(a)} undefined a(true,(console.log)) VM177:2 Uncaught TypeError: Illegal invocation(…)a @ VM177:2(anonymous function) @ VM186:2InjectedScript._evaluateOn @ VM116:875InjectedScript._evaluateAndWrap @ VM116:808InjectedScript.evaluate @ VM116:664 a(true,console.log) VM177:2 Uncaught TypeError: Illegal invocation(…)a @ VM177:2(anonymous function) @ VM188:2InjectedScript._evaluateOn @ VM116:875InjectedScript._evaluateAndWrap @ VM116:808InjectedScript.evaluate @ VM116:664 a(true,()=>console.log) undefined a(true,(e)=>console.log(e)) VM190:2 true undefined a(false,(e)=>console.log(e)) undefined a(true,(e)=>console.log(e)) VM192:2 true undefined