0
What is the difference between == and ===?
4 Answers
+ 2
=== means that the two values have to be indentical to, including of data type whereas == just means that they have to be the same value regardless of data type
0
Example to help understand
1 === 1: true
1 == 1: true
1 === "1": false // 1 is an integer, "1" is a string
1 == "1": true // "1" gets casted to an integer, which is 1
"foo" === "foo": true // both operands are strings and have the same value
0
this means this operator can be used to get if both are same data type or not?
0
this operator evaluates two things first whether the given values are equal or not thn it evaluates their data types if both are true then result is true ..