DEV Community

Discussion on: Why async code is so damn confusing (and a how to make it easy)

Collapse
 
joelnet profile image
JavaScript Joel

You actually have less debugging because all of your functions become testable.

Try unit testing this:

for (var i = 1; i < 6; i++) {
  setTimeout(() => console.log(i), 1000)
}

hint: it sucks.