+ 1
Turning the input into a number
How can i turn the input wrote in prompt() in javascript into a number because when i try to sum to numbers wrote in prompt() they are counted as strings In Python there is a way and it looks like this. float(input("write a number")) this turns the input into a float number
3 ответов
+ 1
You can use Number (yourVar) where yourVar is the name of the variable. For example var num = Number(yourVar).
0
TheWhiteCat💡 thanks
That worked
0
You are welcome, Mario.