Code coverage report for src/findIndex.js

Statements: 100% (21 / 21)      Branches: 100% (10 / 10)      Functions: 100% (1 / 1)      Lines: 100% (9 / 9)      Ignored: 4 statements, 2 branches     

All files » src/ » findIndex.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 171 7 7   7 22 6     16     1        
function findIndex(xs, iteratee, thisArg) {
    let fn = thisArg ? iteratee.bind(thisArg) : iteratee;
    let i = 0;
 
    for (let x of xs) {
        if (fn(x, i, xs)) {
            return i;
        }
 
        i += 1;
    }
 
    return -1;
}
 
export default findIndex;