Revision: 19793
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 30, 2009 18:27 by peta
Initial Code
Number.prototype.times = function(fn) { var i = (this > 0) ? this : 0; while (i--) { fn(); } }
Initial URL
Initial Description
The Number objects value determines how often the supplied function is repeated. Inspired by ROR & Python. "Pollutes" Number's prototype.
Initial Title
JS: Savvy looping on a Number
Initial Tags
javascript, js, number, python
Initial Language
JavaScript