<!DOCTYPE html>
<html>
<head>
<title>逻辑运算符</title>
</head>
<body>
<script type="text/javascript">
var weather = 'sunny';
var temp = 32;
if (weather === 'sunny') {
if (temp > 30) {
console.log('再家里吹空调')
}else{
console.log('天气非常好')
}
}
//逻辑运算 &&:and //:or !:取反
if (weather === 'sunny' &&temp > 30) {
console.log('再家里吹空调')
}
else if(weather === 'sunny' &&temp <= 30){
console.log('天气非常好')
}
</script>
</body>
</html>