This small portion of code took a long time to be noticed.
I thought if I do the following, it would be fine
if('true' == true) {
alert("Does not happen");
}
But it does not pass the if condition.
I thought the double equals ==
matches the value not the type as matching the type is the job of ===
.
Now my questions are why wasn'the true
typecast to 'true'
or why is it checking for the type of these operands?