📜  || - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:13.241000             🧑  作者: Mango

代码示例2
function A(){ console.log('called A'); return false; }
function B(){ console.log('called B'); return true; }

console.log( B() || A() );
// logs "called B" due to the function call,
// then logs true (which is the resulting value of the operator)