Make it to make it

いろいろ作ってアウトプットするブログ

2019-10-15から1日間の記事一覧

async/await再入門

asyncファンクション asyncファンクションが通常のファンクションと何が違うかは、以下の2つの例を見ればわかる。 function hello(ms) { return new Promise(resolve => setTimeout(() => { resolve('Hello from the other side!') }, ms)) } console.log(he…

Promise再入門(3)

Promiseを組み合わせる JavaScriptはPromiseの組み合わせのために、Promise.all()とPromise.race()という2つのビルトイファンクションが用意されている。 Promise.all() Promise.all()はpromiseからなる配列を組み合わせて、それらの処理結果を含むかたちで…