How can I tell this stupid JavaScript to take a float as the value in the prompt function not a string? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 5

How can I tell this stupid JavaScript to take a float as the value in the prompt function not a string?

15th May 2019, 11:11 AM
//(AnOnYmOuS);
2 Réponses
+ 6
You can't but you can convert it afterwards. let num = Number(prompt());
15th May 2019, 11:15 AM
Schindlabua
Schindlabua - avatar
+ 6
@Schindlabua Ok I'll try Thanks
15th May 2019, 11:18 AM
//(AnOnYmOuS);