Code coverage report for object/find.js

Statements: 100% (10 / 10)      Branches: 100% (2 / 2)      Functions: 100% (4 / 4)      Lines: 100% (9 / 9)     

All files » object/ » find.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 201         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;
 
});