Tell us what’s happening:
I’m not sure what function to define with result
Your code so far
const makeServerRequest = new Promise((resolve, reject) => {
// responseFromServer is set to true to represent a successful response from a server
let responseFromServer = true;
if(responseFromServer) {
resolve("We got the data");
responseFromServer.then(result => {
});
} else {
reject("Data not received");
}
});
console.log(result)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Challenge: ES6 - Handle a Fulfilled Promise with then
Link to the challenge: