Add ES6 _.assign alias of _.extend.

Former-commit-id: 20a0e0d295cb90a1756a5831b0b6684b97477170
This commit is contained in:
John-David Dalton
2012-11-11 13:05:52 -08:00
parent 07cbfdb424
commit ec6a709393
7 changed files with 117 additions and 67 deletions

View File

@@ -409,6 +409,14 @@
Foo.prototype = { 'c': 3 };
deepEqual(_.extend({}, Foo), expected);
});
test('should work with `_.reduce`', function() {
var actual = { 'a': 1},
array = [{ 'b': 2 }, { 'c': 3 }];
_.reduce(array, _.extend, actual);
deepEqual(actual, { 'a': 1, 'b': 2, 'c': 3});
});
}());
/*--------------------------------------------------------------------------*/