有什么不同?为什么它在函数 a() 中得到错误?
function a(){
1 == 1 ? return true: ""; // Uncaught SyntaxError: Unexpected token return
}
function b(){
1 == 1 ? console.log(true):""; // correct
}
function c(){
if (1==1) return true; // correct
}
Run Code Online (Sandbox Code Playgroud) javascript ×1