源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <p>AND 操作符 (&&) 如果两个表达式都为true,则返回true,否则返回false。.</p> <p id="demo"></p> <script> var x = 6; var y = 3; document.getElementById("demo").innerHTML = (x < 10 && y > 1) + "<br>" + (x < 10 && y < 1); </script> </body> </html>
运行结果