1 var baseForOwnRight = require('../internal/baseForOwnRight'),
2 createFindKey = require('../internal/createFindKey');
5 * This method is like `_.findKey` except that it iterates over elements of
6 * a collection in the opposite order.
8 * If a property name is provided for `predicate` the created `_.property`
9 * style callback returns the property value of the given element.
11 * If a value is also provided for `thisArg` the created `_.matchesProperty`
12 * style callback returns `true` for elements that have a matching property
13 * value, else `false`.
15 * If an object is provided for `predicate` the created `_.matches` style
16 * callback returns `true` for elements that have the properties of the given
17 * object, else `false`.
22 * @param {Object} object The object to search.
23 * @param {Function|Object|string} [predicate=_.identity] The function invoked
25 * @param {*} [thisArg] The `this` binding of `predicate`.
26 * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
30 * 'barney': { 'age': 36, 'active': true },
31 * 'fred': { 'age': 40, 'active': false },
32 * 'pebbles': { 'age': 1, 'active': true }
35 * _.findLastKey(users, function(chr) {
36 * return chr.age < 40;
38 * // => returns `pebbles` assuming `_.findKey` returns `barney`
40 * // using the `_.matches` callback shorthand
41 * _.findLastKey(users, { 'age': 36, 'active': true });
44 * // using the `_.matchesProperty` callback shorthand
45 * _.findLastKey(users, 'active', false);
48 * // using the `_.property` callback shorthand
49 * _.findLastKey(users, 'active');
52 var findLastKey = createFindKey(baseForOwnRight);
54 module.exports = findLastKey;