//1.用我们的布尔值参与的逻辑运算 true&&false ==false
//2.123&&456 是值或者是表达式参与逻辑运算?
//3.逻辑与短路运算 如果表达式1 结果为真 则则返回表达式2
//如果表达式1为假 那么返回表达式1
console.log(123 && 456); //456
console.log(0 && 456); //0
console.log(0 && 1 + 2 && 456 * 56789); //0
console.log('' && 1 + 2 && 456 * 56789); //''
//如果有空的或者否定的为假 其余是真的 0 '' null undefined NaN
// 如果表达式1 结果为真 则则返回表达式1
// 如果表达式1为假 那么返回表达式2
console.log(123 || 456); //123
console.log(123 || 456 || 456 + 123); //123
console.log(0 || 456 || 456 + 123); //456
//逻辑中断之后,后面就不执行了,所以num=0
var num = 0;
console.log(123 || num++);
console.log(num); //0