github
155 of 156 branches covered (99.36%)
Branch coverage included in aggregate %.
2 of 2 new or added lines in 1 file covered. (100.0%)
1 existing line in 1 file now uncovered.264 of 265 relevant lines covered (99.62%)
381.28 hits per line
1 |
'use strict';
|
|
2 |
|
|
3 |
function arrayFind(arr, fn) { |
|
4 |
if (!Array.isArray(arr)) {
|
|
UNCOV
5
|
return;
|
× |
6 |
} |
|
7 |
|
|
8 |
var idx = 0; |
720✔ |
9 |
while (idx < arr.length) {
|
720✔ |
10 |
var result = fn(arr[idx]);
|
276✔ |
11 |
if (result) {
|
|
12 |
return result;
|
24✔ |
13 |
} |
|
14 |
idx++; |
252✔ |
15 |
} |
|
16 |
} |
|
17 |
|
|
18 |
module.exports = arrayFind; |
288✔ |