"use strict";
function c() {
console.log(1);
}
function repeat(fn, times) {
fn.times = times;
return function() {
if (fn.times) {
fn.times--;
return fn();
} else {
throw "err";
}
}
}
var foo = repeat(c, 3);
foo();
foo();
foo();
foo();
foo();
foo();
网友评论