Like `forEach`, but suitable for use with numbers and strings (which may be falsy).
(array, callback)
| 400 | ts.forEachRight = forEachRight; |
| 401 | /** Like `forEach`, but suitable for use with numbers and strings (which may be falsy). */ |
| 402 | function firstDefined(array, callback) { |
| 403 | if (array === undefined) { |
| 404 | return undefined; |
| 405 | } |
| 406 | for (var i = 0; i < array.length; i++) { |
| 407 | var result = callback(array[i], i); |
| 408 | if (result !== undefined) { |
| 409 | return result; |
| 410 | } |
| 411 | } |
| 412 | return undefined; |
| 413 | } |
| 414 | ts.firstDefined = firstDefined; |
| 415 | function firstDefinedIterator(iter, callback) { |
| 416 | while (true) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…