源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <p>NOT 操作符 (!) 返回true为假语句,假为真语句.</p> <p id="demo"></p> <script> var x = 6; var y = 3; document.getElementById("demo").innerHTML = !(x === y) + "<br>" + !(x > y); </script> </body> </html>
运行结果