+ 2

Explain pls the output of this code

var x ="5", y=10 document.write(+x+y) The output is 15. Why? I thought it should be something like 510...

27th Apr 2018, 4:53 PM
İskender Güneş
İskender Güneş - avatar
2 Antworten
+ 5
+ symbol before X converts X into number/interger type, therfore answer is 15.
27th Apr 2018, 4:58 PM
Rhythm Khandelwal
+ 1
27th Apr 2018, 5:00 PM
İskender Güneş
İskender Güneş - avatar