Skip to content

Instantly share code, notes, and snippets.

@brunomonteiro3
Created May 10, 2017 01:34
Show Gist options
  • Save brunomonteiro3/27af6d18c2b0926cdd124220f83c474d to your computer and use it in GitHub Desktop.
Save brunomonteiro3/27af6d18c2b0926cdd124220f83c474d to your computer and use it in GitHub Desktop.
Generate random number between two numbers in JavaScript
function randomIntFromInterval(min,max){
return Math.floor(Math.random()*(max-min+1)+min);
}
@Gropitel
Copy link

function Numbers(min,max){
console.log(Math.floor(Math.random()*(max-min+1)+min));
}
Numbers(15, 20)

@islam-fawzy25
Copy link

Thanks it´s working good 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment