+ 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 Answers
+ 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);