Type converting equality (==)
It will automatically convert variable to value irrespective of data type, either it is string or number. For an example “2” will be equal to 2 (
"2"== 2 will return
true). So the double equal (==) is an auto type converting equality.
Strict equality (===)
It is strict equality operator i.e it will not convert the values automatically. For an example “2” will not be equal to 2 (
"2"=== 2 will return
Below is the demonstration with simple examples:
0 == false
it will return true because here false is equivalent of 0
0 === false
it will return false because both are different operands
Hope you enjoyed this post and gained knowledge about the difference between
What do you think?
If you have any questions or suggestions please feel free to email us or put your thoughts as comments below. We would love to hear from you. If you found this post or article useful then please share along with your friends and help them to learn.