Does the prompt return by default String
correct? The function Number
does the return conversion of the prompt that is String to number. So when I run the following function and I put numbers in quotes does the message NaN
appear, should not I convert the return to number and execute the calculation?
var num = Number(prompt("Digite um número", ""));
alert("Seu número é a raíz quadrada de " + num * num);