0

If they concatenate

shouldn't be like:

a = "3"+"8"= "38"

b= "38"-"8"="3"

a="38"-"3"="8"

?

I also didn't understand why that solution doesn't work

where did the "0" come from ?

Marco
  • 1,073
  • 9
  • 22

2 Answers2

1

Operator - converts values to numbers and returns NaN if its not convertable

Helios
  • 53
  • 4
0

Substraction automatically converts to a number, where possible, before doing the operation.

TKoL
  • 13,158
  • 3
  • 39
  • 73