Q:

is there a way to make a prompt in JS return a number?

I am trying to make a program which involves the user entering how long they want the timer to run but it seems that prompt can only return a string, is there a way I can get it to return a number?

A:

No, but you can convert the string to a number 
var res = prompt('How long');
var length = parseInt(res, 10);
if (isNaN(length)){
  //enter a number
}

