JavaScript: Mapping and Wrapping Classic Callback Functions to Promises and Async / Await

Lucas Jellema
5 min readJan 11, 2020

Callback functions used to be very common in JavaScript and Node applications. Out of necessity. And with Callback functions came unclear program flows, parallel realities, nested complexity and more.

ECMAScript introduced Promises several years ago and followed that up with the neat await and async syntax. This allows us to have asynchronous execution as part of the regular program flow. Everything orderly neatly and sequentially.

--

--

Lucas Jellema

Lucas Jellema is CTO and IT architect at Conclusion, The Netherlands. He is Oracle ACE Director, one time JavaOne Rockstar and programmer