May 30, 2021 Article blog
Concept: is a mathematical object, not a constructor, it has mathematical constants and function properties and methods
Gets random numbers in a range
Value : Math.floor (Math.random() s total number of possible values plus the first possible value)
Example of a small case code
<script>
Var Arr = []; // Create an empty number set of random numbers
For (var i = 0; i <5; i ++) {// loop print 5 random numbers
Arr [i] = math.round (math.random () * 26 + 1); // value = random number formula
FOR (var j = 0; j <i; j ++) {// loop 5 random numbers
IF (arr [i] == arr [j]) {// is compared
I -; // If equally, the number of times is not recorded because the number of random numbers in the loop can be regenerated.
}
}
}
Console.log (arr); // 5 random numbers to the console
</script>