I don’t understand the difference between == and ===. Also != and !== | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I don’t understand the difference between == and ===. Also != and !==

13th Feb 2018, 10:02 AM
sally
3 Answers
+ 4
The difference is: two == are checking if value a is equal to value b three === are checking type too so if values are equal for eg. both have value 5 then program will check if they are both int or double... != and !== are working on similar way they are just checking if values are different
13th Feb 2018, 10:12 AM
Dejan Francuz🥇
Dejan Francuz🥇 - avatar
+ 1
== is the "equal to" operator which tests for equality while != is the "not equal to" operator while === and !== are comparison operators
13th Feb 2018, 10:14 AM
4South
4South - avatar