본문 바로가기

javascript - callback

 

youtu.be/Nau-iEEgEoM

 

blog.naver.com/wldks79/222184753801

 

[JavaScript] Callback, Promise, Async/Await

In the case of synchronous code, the code runs in blocking mode. In other words, the next statement can not be executed and waits until the previous statement is completed.

So, we need to use the asynchronous code.

If we use the asynchronous code, we can execute the next statement simultaneously and execute statements related to asynchronous code after the asynchronous code finishes.

However, as you can see, if asynchronous operation is nested, you will fall into callback hell.

In addition, this style is hard to handle errors in handling asynchronous.

 

blog.naver.com/wonmylover/222093891601

callback < promise < async/await