(array, predicate)
| 511 | } |
| 512 | ts.find = find; |
| 513 | function findLast(array, predicate) { |
| 514 | for (var i = array.length - 1; i >= 0; i--) { |
| 515 | var value = array[i]; |
| 516 | if (predicate(value, i)) { |
| 517 | return value; |
| 518 | } |
| 519 | } |
| 520 | return undefined; |
| 521 | } |
| 522 | ts.findLast = findLast; |
| 523 | /** Works like Array.prototype.findIndex, returning `-1` if no element satisfying the predicate is found. */ |
| 524 | function findIndex(array, predicate, startIndex) { |
nothing calls this directly
no test coverage detected