This commit is contained in:
David Ralph
2019-03-22 20:11:06 +00:00
parent 8d8831f64b
commit 9d2f4a6b4f
4 changed files with 21 additions and 21 deletions

View File

@@ -38,7 +38,7 @@ module.exports = class Util {
}
static contains(needle) {
let findNaN = needle !== needle;
const findNaN = needle !== needle;
let indexOf;
if (!findNaN && typeof Array.prototype.indexOf === 'function') indexOf = Array.prototype.indexOf;
else {
@@ -46,14 +46,14 @@ module.exports = class Util {
let i = -1,
index = -1;
for (i = 0; i < this.length; i++) {
let item = this[i];
const item = this[i];
if ((findNaN && item !== item) || item === needle) {
index = i;
break;
}
}
return index;
}
};
}
return indexOf.call(this, needle) > -1;
}