Here’s what actually happens internally: 1️⃣ 𝘧𝘦𝘵𝘤𝘩 () immediately returns a Promise 2️⃣ JavaScript sees the Promise is unresolved 3️⃣ The current async function gets paused 4️⃣ Control returns ...
Hence, the solution to this problem which is Typescript that goes ahead and gives Javascript—which is an even weirder language—its strict types making it statically typed, which catches those weird ...