IT用語集 › プログラミング › async / await
非同期コードを同期処理のように書ける構文。
コールバック地獄(fetch().then(r => r.json()).then(d => ...))の代わりに、const d = await fetch().then(r => r.json()) と書ける。コードは上から下へ読めるが、内部ではノンブロッキングで動く。
fetch().then(r => r.json()).then(d => ...)
const d = await fetch().then(r => r.json())
JavaScript、Python、Rust、C#、Kotlin などに存在し、Promise / Future の上に構築されている。