Async Await - The async Keyword

Hi all,

can someone explain why is my following code rejected?

Thank you :slight_smile:

You’re supposed to be reproducing the functionality of withConstructor, which includes returning the same datatype:

function withConstructor(num){
  return new Promise((resolve, reject) => {
    if (num === 0){
      resolve('zero');
    } else {
      resolve('not zero');
    }
  })
}

You’re currently returning the number 0 or the value of the number, but you should be returning the string zero or not zero

1 Like

Yeah, I didn’t know I should return the exactly same result, thanks for catching that!