react / wstein / node_modules / jest-cli / node_modules / istanbul / node_modules / js-yaml / node_modules / argparse / node_modules / lodash / array / findLastIndex.js
80742 viewsvar createFindIndex = require('../internal/createFindIndex');12/**3* This method is like `_.findIndex` except that it iterates over elements4* of `collection` from right to left.5*6* If a property name is provided for `predicate` the created `_.property`7* style callback returns the property value of the given element.8*9* If a value is also provided for `thisArg` the created `_.matchesProperty`10* style callback returns `true` for elements that have a matching property11* value, else `false`.12*13* If an object is provided for `predicate` the created `_.matches` style14* callback returns `true` for elements that have the properties of the given15* object, else `false`.16*17* @static18* @memberOf _19* @category Array20* @param {Array} array The array to search.21* @param {Function|Object|string} [predicate=_.identity] The function invoked22* per iteration.23* @param {*} [thisArg] The `this` binding of `predicate`.24* @returns {number} Returns the index of the found element, else `-1`.25* @example26*27* var users = [28* { 'user': 'barney', 'active': true },29* { 'user': 'fred', 'active': false },30* { 'user': 'pebbles', 'active': false }31* ];32*33* _.findLastIndex(users, function(chr) {34* return chr.user == 'pebbles';35* });36* // => 237*38* // using the `_.matches` callback shorthand39* _.findLastIndex(users, { 'user': 'barney', 'active': true });40* // => 041*42* // using the `_.matchesProperty` callback shorthand43* _.findLastIndex(users, 'active', false);44* // => 245*46* // using the `_.property` callback shorthand47* _.findLastIndex(users, 'active');48* // => 049*/50var findLastIndex = createFindIndex(true);5152module.exports = findLastIndex;535455