I've been trying to make a code that prompts the user to enter a minimum value and a maximum value in order to return a random value from the interval of those two. It's been hours now, and I can't really understand what I'm doing wrong. Also forgive me, I'm a student, so I'm still trying to understand these basic stuff.
I've tried running code, but it returns "NaN". I think the problem here is about the variables or something, so can someone try and point it out?
function userInput(low,high){
return prompt("Enter a minimum value:");
return prompt("Enter a maximum value:");
}
function generateNum(){
return Math.floor(Math.random()*max-min+1)+min;
}
function outputNum(q){
document.getElementById("text1").innerHTML = q;
}
outputNum("Randomly generated number: "+generateNum());
var min = parseInt(userInput());
var max = parseInt(userInput());