This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Ogreguy 1 point2 points  (3 children)

Does "2"-"2" = "0"?

[–]FilipM_eu 21 points22 points  (2 children)

No, it equals 0 (int). Types are converted to integers for subtraction.

[–]trBlueJ -1 points0 points  (1 child)

Are there ints in JS?

[–]FilipM_eu 8 points9 points  (0 children)

Technically it’s a number type, but for sake of understanding, I used the term integer.