跳到主要内容

before

_.before(count, function)
创建一个函数,调用不超过 count 次。 当 count 已经达到时,最后一个函数调用的结果将被记住并返回。

var monthlyMeeting = _.before(3, askForRaise);
monthlyMeeting();
monthlyMeeting();
monthlyMeeting();
// the result of any subsequent calls is the same as the second call