I am trying to create the 3 digit random number using the following function:
gridView.generateData = function( size ) {
var newData = [];
var size = size || 100;
var baseSize = 0;
while( baseSize < size ) {
baseSize++;
newData.push( {
"mk" : Math.floor( Math.random()*999 ) + 100 //3 digit
} );
}
return $q.all( newData );
}
But in the out put object i see there is number of instance having 4 digit numbers to. how to insure only 3 digit using the above function?
thanks in advance.