2.3非同期順序分析
1647 ワード
コード解析
let a = 2;
const p = new Promise((resolve, reject) => {
console.log('spearjin');
setTimeout(() => {
a = 5;
console.log(a);
resolve(a);
}, 0);
});
console.log('hello');
p.then((result) => {
console.log("result: " + result);
});
* 결과 = spearjin, hello, 5, result: 5
* new Promise 함수선언과 호출을 같이 한다
* then메소드는 백그라운에 함수가 들어간다
さあ.今、絵を見て、どのように動いているのかを分析しましょう.



Reference
この問題について(2.3非同期順序分析), 我々は、より多くの情報をここで見つけました https://velog.io/@spearjin/2.3-비동기-함수-분석テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol