Answer the question
In order to leave comments, you need to log in
How to solve this asynchronous task?
Hello, I'm not that good at asynchronous programming yet, and this task blows my mind:
I have an array of unchecked proxies, which I pass to the checkProxy function, from which I would like to receive a promise with checked proxies:
checkProxy(proxies).then(valid_proxies => {
console.log(valid_proxies) //в valid_proxies лежит массив отвалидированных прокси
})
proxy_check(proxy).then(r => {
// прокси рабочий
});
Answer the question
In order to leave comments, you need to log in
Promise.all(proxies.map((p) => check(p)))
.then((check_results) => check_results.filter(....))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question