javascript await / async: no more callback headache ?


If you are developing an html5/javascript app it could possibly happen, that you need to make more async calls sequentially.
It could also often happen, that the output of one call has to be used for another call. If you have many nested calls, you can find them in a state called “pyramid of doom”: the program uses many levels of nested indentation to control access to a function. Error handling and code changes can be very painful!
await and async are “syntactic sugar” that allow a developer to write the code as the calls are synchronous and simplifying very much the design and maintainability of the code and human readability. Under the hood the will be still made async.
Are you ready to use them?