Pythonのrange(配列で返すほう)をJSで書く。 function range(from, to, step) { var i, a = []; if (typeof to == "undefined") { to = from; from = 0; } if (typeof step == "undefined") step = 1; if (step == 0) throw new TypeError("range() step argument must not be zero"); if (from < to) { if (step > 0) for (i = from; i < to; i += step) a.push(i); } else { if (step < 0) for (i = from; i > to; i += step) a.push(i); } re