var arr2 = []; for ( i = 0; i < 20; i++ ) { arr2.push( Math.round( Math.random() * 100 )); } document.write( '<br>' + arr2 );