You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
261 B
14 lines
261 B
5 months ago
|
function arrayLastIndexOf (list, val) {
|
||
|
if (list.lastIndexOf) {
|
||
|
return list.lastIndexOf(val)
|
||
|
}
|
||
|
for (var len = list.length - 1; len >= 0; len--) {
|
||
|
if (val === list[len]) {
|
||
|
return len
|
||
|
}
|
||
|
}
|
||
|
return -1
|
||
|
}
|
||
|
|
||
|
module.exports = arrayLastIndexOf
|