Code coverage report for array/forEach.js

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

All files » array/ » forEach.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241         1 133 3   130   130     470 1         1      
define(function () {
 
    /**
     * Array forEach
     */
    function forEach(arr, callback, thisObj) {
        if (arr == null) {
            return;
        }
        var i = -1,
            n = arr.length;
        while (++i < n) {
            // we iterate over sparse items since there is no way to make it
            // work properly on IE 7-8. see #64
            if ( callback.call(thisObj, arr[i], i, arr) === false ) {
                break;
            }
        }
    }
 
    return forEach;
 
});