Front End Programmer Question:
Download Job Interview Questions and Answers PDF
Explain the difference between == and === ?
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
== 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 Front End Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Do you know what is a closure? | Tell me what is the difference between form get and form post? |