Javascript Math getRandomArbitrary(min, max)
function getRandomArbitrary(min, max) { return Math.random() * (max - min) + min; } function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } var a = [1,2,3];//from ww w.ja va 2s. c o m var b = [4,5,6]; Array.prototype.push.apply(a, b) a.push.apply(a,b) a.push(4,5,6) a // [1, 2, 3, 4, 5, 6]