About CallBack Function

I’m stuck in Promises. But promise isn’t the problem. I don’t understand what “Asynchronous Callbacks” is? Any one please give a concept about it. it will be helpful for me​:grin::grin:

A callback is a function you pass to some other function, which will be invoked (“called”) at some later point. An “asynchronous callback” would be a callback that’s invoked asynchronously, which is to say not in step with the normal program flow. While the promise is waiting to complete, other code runs, then when the promise is resolved, the callback appears to interrupt(*) execution and gets run.

Basically it’s any callback invoked by an asynchronous function. A non-promise example of an asynchronous callback would be the function you pass to setTimeout(). For me, asynchronous callbacks are the only things I ever call “callbacks”. The functions you pass to, say, Array.map() I just call “functions”, but many people do also refer to them as callbacks (synchronous, that is).

* - It doesn’t actually interrupt running code, but the way most JS code is structured makes it look like that. Languages like C actually can preempt code in the middle of running (depending on the framework you’re using), and Go lets you choose the behavior.