what is in javascript code example
Example 1: difference between == and === in javascript
0 == false
0 === false
1 == "1"
1 === "1"
null == undefined
null === undefined
'0' == false
'0' === false
Example 2: js ===
5 =='5'
5 === '5'
Example 3: === javascript
var x = 5
x === 5
x === "5"
Example 4: js !==
var x = 5;
x === 5 returns true
x === "5" returns false
x !== 5 returns false
x !== "5" returns true
x !== 8 returns true
Example 5: === in js
<!DOCTYPE html>
<html>
<body>
<p id="demo"></p>
<script>
var x = abc;
document.getElementById("demo").innerHTML = (x === "ABC");
</script>
</body>
</html>