Skip to content

Commit 12fb473

Browse files
authored
Merge pull request #295 from cee-elle/math-random-function
added math random function and math round
2 parents 2bc1966 + dd2f2fd commit 12fb473

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

JavaScript_Basics/math.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ Math.min(50, 50, 810, 2200, -900); // will return -900
1313
Math.max(230, 250, 10, 300, -900); // will return 300
1414

1515
// round function
16-
Math.random(); // returns a random number
16+
Math.round(5.899);
17+
18+
// returns a random number that is not an integer between 1 to 10.
19+
Math.random() * (10 - 1) + 1;
1720

1821
// Defining variables to carry out the mathematical functions on.
1922
value1 = 10;

0 commit comments

Comments
 (0)