Answer the question
In order to leave comments, you need to log in
How to determine when the recursion ends?
How to determine the end of execution of such a recursive function:
function rec(text) {
asynFunc(text).then(data => {
if (data.length > 10) {
rec(data);
}
})
}
Answer the question
In order to leave comments, you need to log in
function rec(text) {
return asynFunc(text).then(data => {
if (data.length > 10) {
return rec(data);
}
})
}
rec(text).then(() => console.log("Закончилось"));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question