That is just the way javascript works.
Because it is loosely typed, it converts the values to the same type before it compares them. Some other examples that also return true:
0 == false
"12" == 12
1 == true
"" == false
If you don’t want javascript to convert the type before comparing the value, you should use the operator “===” instead of “==”:
[attachment=0]Capture.PNG[/attachment]