javascript math random

Javascript: random int between values

I just want to share with you a very very simple function wich should be part of the Math library of function but it's not.
I'm talking about a function which returns a random integer between two values.
Here's an easy function which you can use:

function random(min, max)
{
   return Math.round(min + Math.random()*(max - min))
}

That's all for today!

Share and Enjoy: