diff --git a/lodash.js b/lodash.js index feabafd3b..367ad55cc 100644 --- a/lodash.js +++ b/lodash.js @@ -4414,7 +4414,7 @@ while (++othIndex < length) { var othArray = arrays[othIndex]; - if (othArray !== array) { + if (othIndex != index) { result[index] = baseDifference(result[index] || array, othArray, iteratee, comparator); } } diff --git a/test/test.js b/test/test.js index e4d2ea5f6..1a70402d5 100644 --- a/test/test.js +++ b/test/test.js @@ -25279,6 +25279,15 @@ assert.deepEqual(actual, []); }); + QUnit.test('`_.' + methodName + '` should return an empty array when comparing the same array', function(assert) { + assert.expect(1); + + var array = [1], + actual = func(array, array, array); + + assert.deepEqual(actual, []); + }); + QUnit.test('`_.' + methodName + '` should return an array of unique values', function(assert) { assert.expect(2);