与
var found = true;
var result = (found && someUndeclaredVariable); // 直接报错
alert(result); // 不会执行到此
var found = false;
var result = (found && someUndeclaredVariable); // 与上面相比,此处没错
alert(result); //works
非
alert(!false); //true
alert(!"blue"); //false
alert(!0); //true
alert(!NaN); //true
alert(!""); //true
alert(!12345); //false
alert(!!"blue"); //true
alert(!!0); //false
alert(!!NaN); //false
alert(!!""); //false
alert(!!12345); //true
或
var found = true;
var result = (found || someUndeclaredVariable); //no error
alert(result); //works
var found = false;
var result = (found || someUndeclaredVariable); //error occurs here
alert(result); //this line never executes