Skip to content

Instantly share code, notes, and snippets.

@hisasann
Created April 24, 2020 06:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hisasann/849845f472f3fbc4463a3dbaf79719ce to your computer and use it in GitHub Desktop.
Save hisasann/849845f472f3fbc4463a3dbaf79719ce to your computer and use it in GitHub Desktop.
メモ:async await に引っ張られて Promise は非同期ぽさがあるが、非同期ではない。
console.log(1);
Promise.all([new Promise((resolve, reject) => {
console.log(3);
})]).then((values) => {
console.log(values);
});
console.log(2);
// 1
// 3
// 2
@hisasann
Copy link
Author

もしも非同期だったら 1 2 3 と表示されるはずだ。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment