|
|
|
|
|
by ehnto
1096 days ago
|
|
You can just wait for the network request to finish before continuing. Many actions require it anyway. Asynchronous code should be intentional and deliberate in my opinion, but in modern JS/Node it is the default which leads to all kinds of crazy workarounds, callback hell and race conditions. Node has the same issue PHP had now, where green devs will crank out code without realising they need to be watching out for these things. Is it cool that a .forEach loop could be async? Heck yeah, should it be the default? The shit people write around .forEach loops suggests, maybe not! |
|
Callback hell? When was the last time you gave an honest effort into JavaScript?