2007-08-10から1日間の記事一覧

Array 拡張

Array.prototype.fill = function(step) { if(this.length != 2 || typeof this[0] != 'number' || typeof this[1] != 'number') return this; var s = this[0]; var e = this[1]; var pl = (typeof step == 'number') ? step : 1; for(var res=[];s<=e;s+=p…