DEV Community

Discussion on: Asynchronous vs Synchronous Callbacks in JS

Collapse
 
jwp profile image
John Peters

Hello, thanks for the articles. Small talking point.

The timer itself runs asynchronously, however the callback runs synchronous when the event is triggered. The pattern shown is an event handler, not an Asynchronous callback.

An Asynchronous call back must use the async/await pattern, or a promise.

Both have the common 'we don't know when it will happen aspect'. Both handle the event but do it differently.

Collapse
 
melguachun profile image
Melissa Guachun

Thanks for pointing that out! :)

Collapse
 
jwp profile image
John Peters

Thank you for writing a great article.