From dd2f2fdd9dd0d07f8b99d1a7fd110b08844e1ba1 Mon Sep 17 00:00:00 2001 From: cindyle Date: Mon, 28 Oct 2019 16:35:02 -0700 Subject: [PATCH] added math random function and math round --- JavaScript_Basics/math.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/JavaScript_Basics/math.js b/JavaScript_Basics/math.js index 7d87893..e90bd45 100644 --- a/JavaScript_Basics/math.js +++ b/JavaScript_Basics/math.js @@ -13,7 +13,10 @@ Math.min(50, 50, 810, 2200, -900); // will return -900 Math.max(230, 250, 10, 300, -900); // will return 300 // round function -Math.random(); // returns a random number +Math.round(5.899); + +// returns a random number that is not an integer between 1 to 10. +Math.random() * (10 - 1) + 1; // Defining variables to carry out the mathematical functions on. value1 = 10;