2020-09-21 17:03:10 +02:00
|
|
|
if (!Array.prototype.findAsync) {
|
2020-09-24 16:53:11 +02:00
|
|
|
Array.prototype.findAsync = async function (asyncCallback) {
|
2020-09-21 17:03:10 +02:00
|
|
|
for (const item of this) {
|
|
|
|
if (await asyncCallback(item)) {
|
|
|
|
return item
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|