JavaScriptの非同期処理は、時間のかかる処理を実行する際に、他の処理を並行して行うことができる仕組みです。 これにより、プログラムの実行を止めることなく、効率的に処理を進めることができます。 非同期処理の代表的な例として、setTimeout関数があり ...
じゃあ次はMDNのドキュメントでawaitを見に行く。 await - JavaScript | MDN await 演算子はプロミス (Promise) を待ち、履行値を取得するために使用します。 非同期関数の中、またはモジュー developer.mozilla.org Promiseを使った関数にしている記事があり勉強になる。
async function getStarWarsData() { try { const response = await fetch('https://swapi.dev/api/people/1/'); const data = await response.json(); console.log(data ...
Asynchronous code (async code) says: go do something while I do other things, then let me know what happened when the results are ready. Also known as concurrency, async is important in a variety of ...