In JavaScript, which of the following expressions evaluates to false?
-
0 == false
-
"1" === 1
-
1 == true
-
1 === true
EXPLANATION
Strict equality (===) means values which we are comparing must have the same type. This means "1" will not be equal to 1("1"===1 it will return false) Type converting equality (==) means automatically it will covert the variable to value irrespective of data type; either it is a string or a number.
Also you have two correct answers "1" === 1 and also 1 === True.
ReplyDeleteoi, fix this.
ReplyDelete