JavaScript Async functions (async/await) Less indentation


With promises:

function doTheThing() {
    return doOneThing()

With async functions:

async function doTheThing() {
    try {
        const one = await doOneThing();
        const another = await doAnother(one);
        return await doSomeMore(another);
    } catch (err) {

Note how the return is at the bottom, and not at the top, and you use the language's native error-handling mechanics (try/catch).