Return to Snippet

Revision: 29081
at August 19, 2010 07:24 by Jamie


Updated Code
// Random integer between
function randomIntegerBetween(minValue,maxValue){
    return Math.floor(Math.random() * (maxValue - minValue + 1)) + minValue;
}

Revision: 29080
at July 21, 2010 02:54 by Jamie


Initial Code
// Random integer between
function randomIntegerBetween(minValue,maxValue){
    return Math.min(minValue + Math.round((Math.random() * (maxValue - minValue))),maxValue);
}

Initial URL

                                

Initial Description
Simple function to return a value between the minValue and the maxValue.

Initial Title
Random Number (Integer) Generator

Initial Tags
number, function

Initial Language
JavaScript