1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <meta name="viewport" content="width=device-width, initial-scale=1.0">
 6     <meta http-equiv="X-UA-Compatible" content="ie=edge">
 7     <title>javascript逻辑非</title>
 8     <!-- 
 9         逻辑或(!)个人理解:
10         前提条件:
11         -逻辑非只会返回布尔值
12         1)!n表否
13         2)!!n双重否定,表肯
14      -->
15 </head>
16 <body>
17     <script>
18         var a=1,b="2",c=0,d="abc",e="",f,g=a-d;
19         /* ! */
20         console.log(!a);//false
21         console.log(!c);//true
22         /* !! */
23         console.log(!!a);//true
24         console.log(!!c);//false
25     </script>
26 </body>
27 </html>