Created
July 16, 2018 12:23
-
-
Save crongro/b8ab8f5fa6d8f8960500b9ea60178026 to your computer and use it in GitHub Desktop.
async_order
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('script start'); | |
requestAnimationFrame(()=> { | |
console.log("requestanimationframe"); | |
}) | |
const interval = setInterval(() => { | |
console.log('setInterval') | |
}, 0) | |
setTimeout(function () { | |
console.log('setTimeout 1'); | |
}, 0); | |
Promise.resolve().then(function () { | |
console.log('promise1'); | |
}).then(function () { | |
setTimeout(() => { | |
console.log('setTimeout 2') | |
Promise.resolve().then(() => { | |
console.log('promise 2') | |
}).then(() => { | |
console.log('promise 3') | |
}).then(() => { | |
clearInterval(interval) | |
}) | |
}, 0) | |
}); | |
setTimeout(function () { | |
console.log('setTimeout 3'); | |
}, 0); | |
Promise.resolve().then(function () { | |
console.log('promise4'); | |
}).then(function () { | |
console.log('promise5'); | |
}); | |
console.log('script end'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment