mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
regression fix: implied global 'i' in _.indexOf() -- thanks to Sveinung Rosaker.
This commit is contained in:
2
underscore-min.js
vendored
2
underscore-min.js
vendored
File diff suppressed because one or more lines are too long
@@ -293,7 +293,7 @@
|
|||||||
// item in an array, or -1 if the item is not included in the array.
|
// item in an array, or -1 if the item is not included in the array.
|
||||||
_.indexOf = function(array, item) {
|
_.indexOf = function(array, item) {
|
||||||
if (array.indexOf) return array.indexOf(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;
|
return -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user