Why is async called async? doesn’t it actually make it synchronous/ sequential since it’s waiting for a response before proceeding to the next step?
function test1(){console.log("test1")};
function test2(){setTimeout(console.log("test2"),2000)}; // screw the syntax
function test3(){console.log("test3")};
async function foo(){
test1();
await test2();
test3();
};
it will return
test1
test2
test3
making the function foo run in order.. doesn’t async make a function synchronous??
vs without the await making it return
test1
test3
test2
isn’t this considered asynchronous since test2() is running while it goes on to test3()? and the async/ await actually makes it a synchronous sequential function since it’s awaiting for a response before proceeding to the next step?
…
someone is going to mention Promises and how async/ await handles promises.
sure.
but why is it called async? wouldn’t it make more sense to be called sync/ await?
am I not understanding async/ await?