+ 2
What is the right answer
var x = 1; var y = "Hello"; x = Math.pow(y,2); y = x; if (x==y){ alert ("true"); } else { alert ("false"); }
2 odpowiedzi
+ 5
anonymous is correct except that x becomes NaN after trying to use Math.pow() on string.
https://code.sololearn.com/WsbXTyy2V62j/?ref=app
for comparing NaN, we use isNaN() or Number.isNaN()
https://www.sololearn.com/post/133451/?ref=app
https://www.sololearn.com/post/133947/?ref=app
+ 2
False