See the difference at a glance.
// Nested callbacks
getUser(id, function(user) {
getPosts(user, function(posts) {
getComments(posts, function(comments) {
render(comments);
});
});
});
// Async/await
const user = await getUser(id);
const posts = await getPosts(user);
const comments = await getComments(posts);
render(comments);