EDIT: The votes to close are wrong. The accepted answer in Repeat Character N Times is not applicable in general. E.g.:
>>>
Underscore.js has a times function that does exactly what you want:
_.times(3, Math.random)
If you don't want to use Underscore, you can just write your own times function (copied and slightly simplified from the Underscore source):
times = function(n, iterator) {
var accum = Array(Math.max(0, n));
for (var i = 0; i < n; i++) accum[i] = iterator.call();
return accum;
};