diff --git a/lib/underscore.catenate.js b/lib/underscore.catenate.js index c91d2e1..24bcd94 100644 --- a/lib/underscore.catenate.js +++ b/lib/underscore.catenate.js @@ -2,16 +2,18 @@ _.catenate = function() { var methods = arguments; + return function() { - var result; + var output; var context = this; - var args = arguments; + var catenateArguments = arguments; + _.each(methods, function(method) { - if (method) - result = method.apply(context, args); + if (method) output = method.apply(context, catenateArguments); }); - return result; + + return output; }; }; -})(_); \ No newline at end of file +})(_);