source: frontend/node_modules/underscore/modules/findKey.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 386 bytes
Line 
1import cb from './_cb.js';
2import keys from './keys.js';
3
4// Returns the first key on an object that passes a truth test.
5export default function findKey(obj, predicate, context) {
6 predicate = cb(predicate, context);
7 var _keys = keys(obj), key;
8 for (var i = 0, length = _keys.length; i < length; i++) {
9 key = _keys[i];
10 if (predicate(obj[key], key, obj)) return key;
11 }
12}
Note: See TracBrowser for help on using the repository browser.