W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <h2>JavaScript Booleans</h2> <p>布尔值只有两个值:true 或 false。</p> <p id="demo"></p> <script> var x = 7; var y = 7; var z = 8; document.getElementById("demo").innerHTML = (x == y) + "<br>" + (x == z); </script> </body> </html>