added an _.zip()

This commit is contained in:
Jeremy Ashkenas
2009-10-26 09:15:14 -04:00
parent cf61edffa8
commit d229e822e7
4 changed files with 68 additions and 44 deletions

View File

@@ -7,6 +7,13 @@ $(document).ready(function() {
var func = function() { return "name: " + this.name; };
var bound = _.bind(func, context);
equals(bound(), 'name: moe', 'can bind a function to a context');
var func = function(salutation, name) { return salutation + ': ' + name; };
func = _.bind(func, this, 'hello');
equals(func('moe'), 'hello: moe', 'the function was partially applied in advance');
func = _.bind(func, this, 'curly');
equals(func(), 'hello: curly', 'the function was completely applied in advance');
});
test("functions: bindAll", function() {