Get random number between two given numbers

To get a random number between two given numbers (max and min) use the following JavaScript code:
var min = 3;
var max = 10;
var number = Math.max(Math.floor(Math.random() * max) + 1, min);