Comment

Comment by TeffenEllis

Huh wow! I did not know that! I think TypeScript always kept this hidden from me, but it makes sense. Another perk of `await` is that it collapses all promises into their final value, regardless of how many nested pending promises are expressed:

  const foo = await Promise.resolve(Promise.resolve("abc"))

  console.log(foo.length) // 3
parent TeffenEllis 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton