| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1 1 7 7 15 7 7 7 1 | define(['./some'], function(some) {
/**
* Returns first item that matches criteria
*/
function find(obj, callback, thisObj) {
var result;
some(obj, function(value, key, obj) {
if (callback.call(thisObj, value, key, obj)) {
result = value;
return true; //break
}
});
return result;
}
return find;
});
|