Given
let doAsynchronousStuff = () => {
return new Promise(resolve => {
setTimeout(() => {
resolve("abcdefg"[Math.floor(Math.random() * 7)])
}, Math.PI * 1 + Math.random())
})
.then(data => console.log(data))
.then(doAsynchronousStuff)
}
why is .then(doAsynchronousStuff)
considered "pseudo-recursion"?
What is the difference between "recursion" and "pseudo-recursion"?
this isn't "real" recursion, because the event loop gets to unwind the stack before the .then callback gets called – Alnitak