// synchronous - Means execute the next one even though the previous
// has not finished yet
// asynchronous - Means wait for the previous operation to finish and then execute
// the next one
// sync example
function getUser(callback) {
setTimeout(() => {
console.log("Alextz")
}, 2000)
// get executed even though the user has not printed yet
callback()
}
getUser(() => console.log("getUser callback called"))
// asynchronous example
// the callback must wait for the username to be displayed 1st
function getUsername(callback) {
setTimeout(() => {
console.log("Alextz")
callback()
}, 2000)
}
getUsername(() => console.log("getUsername callback called"))