JavaScript 事件執行順序

console.log(1); var promise = new Promise((resolve) => { console.log(2); resolve(3); }); promise.then((val) => console.log(val)); setTimeout(()=>{console.log(4)},0); console.log(5) 1 2 5 3 4
相關文章
相關標籤/搜索