+ 1
Output?
var x=NaN; var y=" "; var z=x+y; alert(z+4); //alerts NaN 4 alert(NaN+4); //alerts NaN Why is the 2nd alert showing only NaN while the 1st one shows NaN 4 ?
1 Resposta
+ 6
1st one:
NaN + " " + 4 = "NaN " + 4 = "NaN 4"
2nd one:
NaN + 4 = NaN