re: 6 points you need to know about async/await in JavaScript VIEW POST


I’m not sure why the first block of code in the article uses promises like the old callback hell, but here it is the proper way to write that first block of code:

  .then( sortByToppings )
  .then( checkDeliveryOptions )
  .then( checkBirthdayGift )
  .then( sendToCustomer ); 

And, in my opinion, it looks better then the alternatives offered by the article, not mentioning the testability of it.


Agree, I think promises are better that async/await when it comes to function composition.

code of conduct - report abuse