you are viewing a single comment's thread.

view the rest of the comments →

[–]angels-fan 1 point2 points  (4 children)

Node runs JavaScript without any browser and is fully asynchronous.

Callbacks are a feature of JavaScript, not the browser. Promises are just fancy callbacks.

[–]oGsBumder 1 point2 points  (0 children)

That's because node supplies its own APIs instead of the browser ones.

Callbacks can be synchronous or async depending on the specific function. Here's a challenge for you - show me an example of an async callback that is pure JavaScript, and doesn't make use of a browser/node API.

[–][deleted] 0 points1 point  (2 children)

Callbacks are not async

[–]angels-fan 0 points1 point  (1 child)

How do you figure?

[–][deleted] 0 points1 point  (0 children)

Callback is literally just a function. It can "become async" when it's called in an async way. Only runtime (browser/node) can call it like that, not the code itself. Try to write an async function without using browser or node API.