真: 除了假都是真
假: false 数字0 空字符串 null undefined NAN
逻辑运算符有 与(&&) 或(||) ⾮(!)
&& 全部真才返回真
|| ⼀个真就返回真
! 真变成假,假变成真
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
//判断里面的真假
// 假: false 数字0 空字符串 null undefined NAN
//与 && 意思是判断条件都需要为真才返回真
var a=false
var b=undefined
var c=null
// if( a && b && c){
// console.log('a和b都是真的')
// }else{
// console.log('a和b不全是真')
// }
//或 || 只需要有一个条件成立为真 就返回真
// if( a || b || c){
// console.log('a或b或c有一个为真')
// }else{
// console.log('三者都为假')
// }
// ! 非 真变成假 假变成真
if(!a){
console.log('a是假')
}
</script>
</body>
</html>