Code coverage report for src/nth.js

Statements: 100% (19 / 19)      Branches: 100% (8 / 8)      Functions: 100% (1 / 1)      Lines: 100% (7 / 7)      Ignored: 4 statements, 2 branches     

All files » src/ » nth.js
1 2 3 4 5 6 7 8 9 10 11 12 13 141 90   90 177 79     98          
function nth(xs, n) {
    let i = 0;
 
    for (let x of xs) {
        if (i === n) {
            return x;
        }
 
        i += 1;
    }
}
 
export default nth;