You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							15 lines
						
					
					
						
							406 B
						
					
					
				
			
		
		
	
	
							15 lines
						
					
					
						
							406 B
						
					
					
				| var _cb = require('./_cb.js');
 | |
| var keys = require('./keys.js');
 | |
| 
 | |
| // Returns the first key on an object that passes a truth test.
 | |
| function findKey(obj, predicate, context) {
 | |
|   predicate = _cb(predicate, context);
 | |
|   var _keys = keys(obj), key;
 | |
|   for (var i = 0, length = _keys.length; i < length; i++) {
 | |
|     key = _keys[i];
 | |
|     if (predicate(obj[key], key, obj)) return key;
 | |
|   }
 | |
| }
 | |
| 
 | |
| module.exports = findKey;
 |