Answer the question
In order to leave comments, you need to log in
How to recurse with a promise in Javascript?
You need to make the function recursive with a promise.
function a () {
b().then(() => {})
function b () {
return new Promise((resolve, reject) => {
for (let i = 0; i < 10; i++) {
if (i < 10) {
b()
} else {
resolve(true)
}
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question