mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Fixing indexOf([], undefined, true) to return -1 insead 0
This commit is contained in:
@@ -3165,8 +3165,9 @@
|
||||
equal(_.indexOf(array, 3), 2);
|
||||
});
|
||||
|
||||
test('should return `-1` for an unmatched value', 1, function() {
|
||||
test('should return `-1` for an unmatched value', 2, function() {
|
||||
equal(_.indexOf(array, 4), -1);
|
||||
equal(_.indexOf([], undefined, true), -1);
|
||||
});
|
||||
|
||||
test('should work with a positive `fromIndex`', 1, function() {
|
||||
@@ -3197,6 +3198,7 @@
|
||||
test('should work with `isSorted`', 1, function() {
|
||||
strictEqual(_.indexOf([1, 2, 3], 1, true), 0);
|
||||
});
|
||||
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user