javascript generate a random integer number in a range of numbers

Solutions on MaxInterview for javascript generate a random integer number in a range of numbers by the best coders in the world

showing results for - "javascript generate a random integer number in a range of numbers"
Arabella
21 Sep 2020
1const min = 1;
2const max = 4;
3const intNumber = Math.floor(Math.random() * (max - min)) + min;
4console.log(intNumber); //> 1, 2, 3