Opal-Estate-Pro/node_modules/indexof/index.js
2019-09-13 11:27:52 +07:00

10 lines
199 B
JavaScript
Executable File

var indexOf = [].indexOf;
module.exports = function(arr, obj){
if (indexOf) return arr.indexOf(obj);
for (var i = 0; i < arr.length; ++i) {
if (arr[i] === obj) return i;
}
return -1;
};