While _.findKey mimics _.findIndex, it lacks a complement to Array.prototype.indexOf.
Given a single dimensional array:
var states = {
'AL': 'Alabama',
'AK': 'Alaska',
'AZ': 'Arizona',
'AR': 'Arkansas'
};
I would expect _.findKey(states, 'Alaska') === 'AK', however the _.pluck shorthand is looking for an object with a key of 'Alaska' so the return is undefined;
Shorthands are consistent in their behavior it would get considerable more complex to make their behavior variable. You may be able to use _.isEqual via
_.findKey(states, _.partial(_.isEqual, 'Alaska'));
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Shorthands are consistent in their behavior it would get considerable more complex to make their behavior variable. You may be able to use
_.isEqualvia_.findKey(states, _.partial(_.isEqual, 'Alaska'));