Skip to content

Instantly share code, notes, and snippets.

@MihailoJoksimovic
Created March 21, 2017 17:37
Show Gist options
  • Save MihailoJoksimovic/dcc2d7686147fa6ec522c84f18d51e6a to your computer and use it in GitHub Desktop.
Save MihailoJoksimovic/dcc2d7686147fa6ec522c84f18d51e6a to your computer and use it in GitHub Desktop.
console.log('script start')
const interval = setInterval(() => {
console.log('setInterval')
}, 0)
setTimeout(() => {
console.log('setTimeout 1')
Promise.resolve().then(() => {
console.log('promise 3')
}).then(() => {
console.log('promise 4')
}).then(() => {
setTimeout(() => {
console.log('setTimeout 2')
Promise.resolve().then(() => {
console.log('promise 5')
}).then(() => {
console.log('promise 6')
}).then(() => {
clearInterval(interval)
})
}, 0)
})
}, 0)
Promise.resolve().then(() => {
console.log('promise 1')
}).then(() => {
console.log('promise 2')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment