function getRandomNumberBetween(min,max){ return Math.floor(Math.random()*(max-min+1)+min); } //usage example: getRandomNumberBetween(20,400);
const min = 1; const max = 4; const intNumber = Math.floor(Math.random() * (max - min)) + min; console.log(intNumber); //> 1, 2, 3
const randomInteger = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
const randomArrayInRange = (min, max, n) => Array.from({ length: n }, () => Math.floor(Math.random() * (max - min + 1)) + min); // Example randomArrayInRange(1, 100, 10);