JavaScript that generates a random number between 1 and 10. Change "10" to whatever range you need.
1const randomNumber = Math.floor(Math.random() * 10) +1;