Synchronous callback

Example: Array traversal of the associated callback function/Promise’s excutor

const arr = [1.3.5]
arr.forEach(item= >{
    console.log(item)
})
console.log('after the forEach')
Copy the code

An asynchronous callback

Example: timer callback/Ajax callback/Promise success callback/failure callback

setTimeout(() = > {
    console.log('timeout callback()')},0)
console.log('the setTimeout ()')
Copy the code