I've been trying to make an infinite loop in Node js, and came across this problem. I experimented a bit and came up with these three functions.
async function rc1(){
rc1();
}
//-> stack overflow error
async function rc2(){
await rc2();
}
//-> stack overflow error
async function a(){}
async function rc3(){
await a();
rc3();
}
//-> no stack overflow error
Why does this happen?
I've been reading up on the async/await tutorials, but most just post code. There are great visualizers but they don't show any examples of the await code. If there are any resources that would be great.