0

My new job has a lot of functions that look like this

function doThing() {
    return new Promise((resolve, reject) => {
        if (???) resolve(???)
        reject(???)
    })
}

I'm considering refactoring it to

async function doThing() {
    if (???) return ???
    throw ???
}

But just wanted to make sure there are no differences to the two before I do.

ZeroSevenTen
  • 1,122
  • 2
  • 9
  • 20

0 Answers0