+ 5

If (a==b) and if (a===b) are the same??

4th Apr 2017, 10:12 AM
Mr Sab
8 Answers
+ 16
tl;dr == checks the values. === checks the values and the data types
4th Apr 2017, 10:21 AM
Hatsy Rei
Hatsy Rei - avatar
+ 8
(a == b) returns true if value of 'a' and 'b' are equal else false. (a === b) returns true if 'a' and 'b' are of same type and their values are equal else false.
4th Apr 2017, 10:15 AM
Cyrus Ornob Corraya
Cyrus Ornob Corraya - avatar
+ 8
=== isn't there in C++... Why use a C++ tag then?
4th Apr 2017, 12:13 PM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 7
C# also doesn't support === operator. He just added every language he knows.
4th Apr 2017, 12:16 PM
Cyrus Ornob Corraya
Cyrus Ornob Corraya - avatar
+ 6
@Mr Sab Thats what I'm saying! Its there in Java but not in C++!
4th Apr 2017, 2:05 PM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 2
doesn't support === in java ? ?
4th Apr 2017, 1:53 PM
Mr Sab
+ 1
mmm ok thx my frnd
4th Apr 2017, 6:10 PM
Mr Sab