Promise

동기

function a(){
    console.log("A");
}
function b(){
    console.log("B");
}
a();
b();
//A
//B

비동기

function a(){
    setTimeout(function(){
        console.log("A");
    },1000)
}
function b(){
    console.log("B");
}
a();
b();
//B
//A

콜백 지옥

Last updated

Was this helpful?