Javascript Number upto(up, iterator)
Number.prototype.upto = function (up, iterator) { for (var i = this.valueOf(); i <= up; i++) { iterator(i);// ww w. j a va 2 s . c o m } return this.valueOf(); };