源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <p>删除注释(在每行开头)以测试每个案例:</p> <p id="demo"></p> <script> var x; //x = (0 == ""); // true //x = (1 == "1"); // true //x = (1 == true); // true //x = (0 === ""); // false //x = (1 === "1"); // false //x = (1 === true); // false document.getElementById("demo").innerHTML = x; </script> </body> </html>
运行结果