javascript random number in range

JavaScript
const rnd = (min,max) => { return Math.floor(Math.random() * (max - min + 1) + min) };function getRandomNumberBetween(min,max){
    return Math.floor(Math.random()*(max-min+1)+min);
}

//usage example: getRandomNumberBetween(20,400); 
const randomInteger = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;Math.floor(Math.random() * 10);function getRandomIntInclusive(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive 
}function getRandomInt(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  return Math.floor(Math.random() * (max - min)) + min; //The maximum is exclusive and the minimum is inclusive
}

Source

Also in JavaScript: