mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
regression fix: implied global 'i' in _.indexOf() -- thanks to Sveinung Rosaker.
This commit is contained in:
@@ -293,7 +293,7 @@
|
||||
// item in an array, or -1 if the item is not included in the array.
|
||||
_.indexOf = function(array, item) {
|
||||
if (array.indexOf) return array.indexOf(item);
|
||||
for (i=0, l=array.length; i<l; i++) if (array[i] === item) return i;
|
||||
for (var i=0, l=array.length; i<l; i++) if (array[i] === item) return i;
|
||||
return -1;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user