<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>javascript逻辑非</title>
<!--
逻辑或(!)个人理解:
前提条件:
-逻辑非只会返回布尔值
1)!n表否
2)!!n双重否定,表肯
-->
</head>
<body>
<script>
var a=1,b="2",c=0,d="abc",e="",f,g=a-d;
/* ! */
console.log(!a);//false
console.log(!c);//true
/* !! */
console.log(!!a);//true
console.log(!!c);//false
</script>
</body>
</html>
05-26 16:40