Code coverage report for array/combine.js

Statements: 100% (9 / 9)      Branches: 100% (2 / 2)      Functions: 100% (3 / 3)      Lines: 100% (8 / 8)     

All files » array/ » combine.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 211           1   1   1 3 2       1   1    
define(['./indexOf'], function (indexOf) {
 
    /**
     * Combines an array with all the items of another.
     * Does not allow duplicates and is case and type sensitive.
     */
    function combine(arr1, arr2) {
 
        var x, length = arr2.length;
 
        for (x = 0; x < length; x++) {
            if (indexOf(arr1, arr2[x]) === -1) {
                arr1.push(arr2[x]);
            }
        }
 
        return arr1;
    }
    return combine;
});