UNPKG
classes-component
Version:
latest (1.1.3)
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0
0.0.1
Cross-browser element class list
classes-component
/
components
/
component-indexof
/
index.js
10 lines
(8 loc)
•
199 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
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
; };