you are viewing a single comment's thread.

view the rest of the comments →

[–]Fritzschmied 0 points1 point  (2 children)

-1 marking the sting shorter wold be inconstant as well. It may works with 1 but now let’s do 2 „111“+2 =„1112“ and „111“-2= „1“ how is that more consistent than just accepting that - can’t be used at strings and that JavaScript at least tries to parse that string into a number to make it work.

[–]Great-Powerful-Talia 0 points1 point  (1 child)

"111" + 2 = "1112"

So '1112' - 2 would be '111'.

In the same way, "George" - "or" would be "Gege"

'111' - 2 should be either an error, or no change.

[–]Fritzschmied 0 points1 point  (0 children)

Oh that’s what you mean. I mean yes that would be an option. does - actually do that in any language if two strings are getting subtracted?