The == operator will compare for equality after doing any necessary type conversions. The === operator will not do any conversion before comparing, so if two values are not of the same type, === will simply return false.
Let us take the case for ‘===’ operator
Since here the value as well as the type of camparing elements matched and the condition is satisfied, hence returns true.
Now let us see another example:
Since, here the value with which it is being compared have same values but not of same type, hence the condition is not satisfied. And hence it returns false.
Let us take the case for ‘==’ operator
Since ‘==’ compared for equality after doing any necessary type conversions.
And would result into a false only if the values are not identical.
As the values are not identical.
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.