Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h2>JavaScript Comparisons</h2> <p>Remove the comment (at the beginning of each line) to test each case:</p> <p id="demo"></p> <script> let 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>