Answers for "val generate Random Number : max:int * int val generate Random Number : max:float -> float val it : max:int -> int val generateRandomNumber : max:float -> int val generateRandomNumber : max:int -> int"

12

javascript random number between 0 and 10

Math.floor(Math.random() * 10);
Posted by: Guest on November-24-2019
2

javascript get random array of integre in given range

const randomArrayInRange = (min, max, n) => Array.from({ length: n }, () => Math.floor(Math.random() * (max - min + 1)) + min);

// Example
randomArrayInRange(1, 100, 10);
Posted by: Guest on July-03-2020
-1

function to get random number from min max range

funtion getRandomNumber(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max-min) )
}
Posted by: Guest on July-11-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language