From e28f3c5aeab6c669aad28ce7be333ccb5fdbc9dc Mon Sep 17 00:00:00 2001 From: Divlo Date: Thu, 29 Aug 2019 23:53:28 +0200 Subject: [PATCH] Cleaner return randomNumber --- scripts/fonctions.js | 2 +- scripts/main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/fonctions.js b/scripts/fonctions.js index 87db173..fda66d3 100644 --- a/scripts/fonctions.js +++ b/scripts/fonctions.js @@ -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) { diff --git a/scripts/main.js b/scripts/main.js index ddeeddd..481fbb7 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -44,7 +44,7 @@ $(function () { } else { - $('.results').html("Nombre aléatoire compris entre " + minEntered + " inclus et " + maxEntered + " inclus : " + result); + $('.results').html(result); } } });