Here is a simple Javascript code which gives you a random whole number within the given range of numbers:
var randNum = Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum;
where, maxNum is the upper limit and minNum is the lower limit of the range, and they are inclusive.