From 51b8293ceed3e2db6e81f927e1f68f0ecdccae30 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Mon, 14 Nov 2011 14:14:30 -0500 Subject: [PATCH] re-styling previous commit. --- underscore.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/underscore.js b/underscore.js index 8032357c3..bf0e70792 100644 --- a/underscore.js +++ b/underscore.js @@ -595,9 +595,10 @@ // Returns a function that will only be executed after being called N times. _.after = function(times, func) { - return times ? function() { + if (times <= 0) return func(); + return function() { if (--times < 1) { return func.apply(this, arguments); } - } : func(); + }; }; // Object Functions