_.before

before_.before(count, function)
Creates a version of the function that can be called no more than count times. The result of the last function call is memoized and returned when count has been reached.

var monthlyMeeting = _.before(3, askForRaise);
monthlyMeeting();
monthlyMeeting();
monthlyMeeting();
// the result of any subsequent calls is the same as the second call
doc_Underscore
2016-04-09 09:05:17
Comments
Leave a Comment

Please login to continue.