number comparison javascript code example
Example 1: js ===
5 =='5' // true: ignores type
5 === '5' // false: includes type
Example 2: === javascript
// === means equal value and equal type
var x = 5
// true
x === 5
// false
x === "5"
Example 3: js !==
var x = 5;
// === equal value and equal type
// e.g. 1.
x === 5 returns true
// e.g. 2.
x === "5" returns false
// !== not equal value or not equal type
// e.g. 1.
x !== 5 returns false
// e.g. 2.
x !== "5" returns true
// e.g. 3.
x !== 8 returns true