0
Can anyone explain this ?!
What is the output of this code? var a="4"; var b=parseInt(a,10); var c="8"; var d= parselnt(c, 10); var e = document.write(b + d); how come the result is 12??????
1 Réponse
+ 14
4+8 =12
the parseInt() function is converting its first parameter to int.
The second parameter (10) is the base. It means it is converted to decimal.