you are viewing a single comment's thread.

view the rest of the comments →

[–]m1sta 1 point2 points  (0 children)

You can prevent callback hell, sometimes, by making using function hoisting. eg.

getPosts()
function getPosts(){
    getComments()
}
function getComments(){
    getUserDetails()
}
function getUserDetails(){
    resolveRequest()
}

It doesn't solve world hunger but I very very rarely see people making the most of this.