Need help with a pretty basic function
I'm coding an IF game, and am trying to do the following:
1) set a variable to a user-input value via prompt()
2) check to see that the variable is a number in between 2 specific values
3) if not, display a message to the user and re-prompt for the variable
My thought was that declaring the variable globally and creating a function to check and see if the necessary conditions were met via while loops was the way to go, but I'm running into some problems. Any help would be greatly appreciated!