9
itch96
8y

javaScript:

0 == "0" // true
0 // false
"0" // true

o.0

Comments
  • 4
    "0" is a string and not empty, 0 is an int, by default 0 is false and above is true when cast to bool.
    by comparing 0 == "0" i imagine it "typeCasts", by taking the value of that string for the comparison.

    now, dont take my words for the truth, because i didnt bother looking it up and just gave my guess.
  • 1
    Would be the same in python
Add Comment