HTML Developer Question: Download HTML Developer PDF

Tell me what is the difference between == and === ?

Tweet Share WhatsApp

Answer:

The 3 equal signs mean "equality without type coercion". Using the triple equals, the values must be equal in type as well.

== is equal to
=== is exactly equal to (value and type)
0==false // true
0===false // false, because they are of a different type
1=="1" // true, auto type coercion
1==="1" // false, because they are of a different type

Download HTML Developer PDF Read All 75 HTML Developer Questions
Previous QuestionNext Question
Explain me what are some of the online tools and resources you use when you have a problem? Where do you go to ask questions?Do you know what are “web workers”?