Cleaner return randomNumber
This commit is contained in:
parent
43b337238e
commit
e28f3c5aea
@ -51,7 +51,7 @@ function randomNumber(min, max) {
|
||||
if (!isNaN(min) && !isNaN(max) && min < max)
|
||||
{
|
||||
let randomNumber = Math.floor(Math.random() * (max - min +1)) + min;
|
||||
return randomNumber;
|
||||
return "Nombre aléatoire compris entre " + min + " inclus et " + max + " inclus : " + randomNumber;
|
||||
}
|
||||
else if (min > max)
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ $(function () {
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.results').html("Nombre aléatoire compris entre " + minEntered + " inclus et " + maxEntered + " inclus : " + result);
|
||||
$('.results').html(result);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user