0

Difference between == and === in JavaScript

9th Jun 2018, 9:53 AM
Reza Bahramnejhad
Reza Bahramnejhad - avatar
2 Answers
+ 3
The 3 equal signs mean "equality without type coercion". Using the triple equals, the values must be equal in type as well. 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
9th Jun 2018, 9:54 AM
Reza Bahramnejhad
Reza Bahramnejhad - avatar
+ 2
Hi Reza Bahramnejhad , Hope you are doing great. You should not ask and answer by yourself and then mark it best too. Please read this- https://www.sololearn.com/discuss/1316935/?ref=app
9th Jun 2018, 12:57 PM
Sachin Artani
Sachin Artani - avatar