My sollution doesn't work why? Complete a Promise with resolve and reject

Tell us what’s happening:

I think i did every thing right yet my sollution doesn’t pass
why not?

Your code so far


const makeServerRequest = new Promise((resolve, reject) => {
// responseFromServer represents a response from a server
let responseFromServer;
  
if(responseFromServer == true) {
resolve("We got the data");
} else {  
 reject ("Data not received");
}
});

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36.

Challenge: Complete a Promise with resolve and reject

Link to the challenge:

since responseFromServer is a boolean ,so you don’t need to compare again

1 Like

But even if it’s double compared should’t it still pass?

since we are working with freecodecamp console, it might be expecting us not make any comparisions as it is a boolean.

1 Like