== ignores the datatype of variable and === does not it.
Example:
4 == "4" => true4 === "4" => false4 === 4 => true
4 == "4" => true
4 === "4" => false
4 === 4 => true
Ex: 1 === ‘1’ => False 1 === 1 => True 1 === ‘5’ => False
In detail Example
0 == false // true0 === false // false, because they are of a different type1 == "1" // true, automatic type conversion for value only1 === "1" // false, because they are of a different typenull == undefined // truenull === undefined // false'0' == false // true'0' === false // false
0 == false // true
0 === false // false, because they are of a different type
1 == "1" // true, automatic type conversion for value only
1 === "1" // false, because they are of a different type
null == undefined // true
null === undefined // false
'0' == false // true
'0' === false // false
Check this video which explains clearly,
https://www.youtube.com/watch?v=S7p9QStPUGo
Thanks.