0
What is "2" + "2" - "2'" on JavaScript? Can I get explanation to it
I've been having various questions on solving calculations on JavaScript. I'd need some help here
2 odpowiedzi
+ 3
+ is both additional and concatenation in javascript so it concatenation if any one is not number.
But - meaning only subtraction
Therefore "2"+"2" = 22
22 - 2 = 20
+ 1
丹ⓨㄩک廾 almost ^^
exactly "2" + "2" = "22"
"22" - "2" = Number("22") - Number("2") = 22 - 2 = 20
I guess you know that, but I think Onyeji Chiagozie Victor isn't necessary aware of implicit casting under the hood ;)