<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
<script>
setTimeout(function () {
console.log(1);
},1000);
new Promise(function (resolve,reject) {
resolve(2);
// reject(3)
}).then(console.log)
// promise异步执行微任务,比正常执行的异步函数列队要早
console.log(4);
</script>
</html> // 4 2 1
promise.异步执行微任务。面试题
猜你喜欢
转载自blog.csdn.net/thinkingw770s/article/details/82625034
今日推荐
周排行