Javascript random integer between two numbers

Mar 17, 2014, by admin

A very simple and useful method to find a random integer between two numbers.  Found this simple javascript function to calculate random integer between two numbers or intervals. Posting here for a quick reference.

function randMaxMin(min,max)
{
return Math.floor(Math.random()*(max-min+1)+min);
}
console.log(randMaxMin(1500, 2500));

Hope this post will help you for more updates like the page Bugtreat Technologies