What's difference in use between == and ===? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What's difference in use between == and ===?

24th Oct 2015, 8:20 AM
Jan Duniec (jasniec)
Jan Duniec (jasniec) - avatar
5 Answers
+ 2
== will return true if (5=5) or (5="5") === will return true if (5===5) but will return false if (5==="5") becoz 5 is a integer and "5" is string. they are equal but are not of same type. === is strict compression operator.
4th Apr 2016, 5:02 PM
Rohan Paradke
Rohan Paradke - avatar
+ 1
"==" will return the argument to be true if another object have the same property or value while "===" will return an argument to be true if more than one object is being compared with the first operand.
5th Jul 2016, 11:28 AM
Avijit Bhattacharjee
Avijit Bhattacharjee - avatar
+ 1
== defines only same value..But === defines not only same value but also same data type
28th Sep 2016, 8:08 AM
sourav podder
sourav podder - avatar
0
5=='5' will return true 5==='5' will return false
12th Dec 2015, 5:13 PM
Punit Vaswani
Punit Vaswani - avatar
0
one represents "equal". one represents "identical".
29th Apr 2016, 5:24 PM
Jason Webb
Jason Webb - avatar