| | |
| | | 'use strict'; |
| | | /* eslint-disable es/no-array-prototype-lastindexof -- safe */ |
| | | /* eslint-disable es-x/no-array-prototype-lastindexof -- safe */ |
| | | var apply = require('../internals/function-apply'); |
| | | var toIndexedObject = require('../internals/to-indexed-object'); |
| | | var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); |
| | | var lengthOfArrayLike = require('../internals/length-of-array-like'); |
| | |
| | | // https://tc39.es/ecma262/#sec-array.prototype.lastindexof |
| | | module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { |
| | | // convert -0 to +0 |
| | | if (NEGATIVE_ZERO) return $lastIndexOf.apply(this, arguments) || 0; |
| | | if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0; |
| | | var O = toIndexedObject(this); |
| | | var length = lengthOfArrayLike(O); |
| | | var index = length - 1; |