<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script>
// 1.&& 两边必须都是true结果才是true
var a = true
var b = true
console.log(a && b)
var c = "衣服"
var d = 300
console.log(c === "家电" && d > 200)
console.log(c === "衣服" && d > 200)
// 2.|| 或 只要有一边是true结果就是true,其他都是false
var day = 5
console.log(day === 6 || day ===7)
console.log(day === 5 || day ===7)
// 3.!取反
var s = true
var ss = false
console.log(!s,!ss)
// 特殊情况
// 1.!!a ----转换成布尔值
var x = "1111"
console.log(!!x)
// && ||短路用法 不满足前边,后边不会执行
var y = 100
console.log(y && y.toString())
var z = "赵钱孙李"
document.write(z || "这个家伙很懒")
</script>
</head>
<body>
</body>
</html>