Answers for "how i rturn random number js"

5

get random numbers javascript

//Write the following code to get a random number between 0 and n
Math.floor(Math.random() * n);
Posted by: Guest on June-20-2020
2

generate random number js

function getRandomIntInclusive(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min;
}
Posted by: Guest on June-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language