diff --git a/lodash.js b/lodash.js index 3d3ab18fe..e84e66e01 100644 --- a/lodash.js +++ b/lodash.js @@ -4561,7 +4561,7 @@ var key = keys[index]; if (values) { result[key] = values[index]; - } else { + } else if (key) { result[key[0]] = key[1]; } } diff --git a/test/test.js b/test/test.js index c03a763b3..704d9bfeb 100644 --- a/test/test.js +++ b/test/test.js @@ -3576,6 +3576,17 @@ /*--------------------------------------------------------------------------*/ + QUnit.module('lodash.zipObject'); + + (function() { + test('should skip falsey elements in a given two dimensional array', function() { + var actual = _.zipObject([['a', 1], ['b', 2]].concat(falsey)); + deepEqual(actual, { 'a': 1, 'b': 2 }); + }); + }()); + + /*--------------------------------------------------------------------------*/ + QUnit.module('lodash(...).shift'); (function() {