UNPKG

301 BJavaScriptView Raw
1
2
3 /**
4 * Iterates over a callback a set amount of times
5 */
6 function times(n, callback, thisObj){
7 var i = -1;
8 while (++i < n) {
9 if ( callback.call(thisObj, i) === false ) {
10 break;
11 }
12 }
13 }
14
15 module.exports = times;
16
17