What do you mean by identical in operators? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What do you mean by identical in operators?

There is a equal to operator and also a equal to and identical operator, what does that mean?

15th Dec 2016, 3:16 AM
Ananth Vishwanath
Ananth Vishwanath - avatar
1 Answer
+ 3
The equal to operator (==) will compare whether two values are equal, but the identical operator (===) will compare whether two values are equal and of the same data type. For instance: 1 == "1" is true, but 1 === "1" is false because 1 is an integer and "1" is a string.
15th Dec 2016, 5:32 AM
Antek