mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
added an _.zip()
This commit is contained in:
@@ -37,6 +37,12 @@ $(document).ready(function() {
|
||||
equals(_.intersect(stooges, leaders).join(''), 'moe', 'can take the set intersection of two arrays');
|
||||
});
|
||||
|
||||
test('arrays: zip', function() {
|
||||
var names = ['moe', 'larry', 'curly'], ages = [30, 40, 50], leaders = [true];
|
||||
var stooges = _.zip(names, ages, leaders);
|
||||
equals(_.toString(stooges), 'moe,30,true,larry,40,,curly,50,', 'zipped together arrays of different lengths');
|
||||
});
|
||||
|
||||
test("arrays: indexOf", function() {
|
||||
var numbers = [1, 2, 3];
|
||||
numbers.indexOf = null;
|
||||
|
||||
Reference in New Issue
Block a user