0
Math.random to guess a random number?
function guessMyNumber(number){ if (Math.floor(Math.random() * 6)) == (number){ return "yes"; }else{ return "no"; } } console.log(guessMyNumber(3));
2 Antworten
+ 1
Check if loop again,
And correct it to following,
if (Math.floor(Math.random() * 6) ==(number)){
0
Thanks, Abhay:).