In the following code, the output clearly shows that rejected is within the created promise1
object. Yet when I look at MDN, there is no property indicating whether a promise is resolved or rejected. How does the program know whether a promise is accepted? Where is this information stored?
const promise1 = new Promise((resolve, reject) => {
throw 'Uh-oh!';
});
console.log(promise1); //Promise { <rejected> 'Uh-oh!' }
promise1.catch((error) => {
console.error(error);
});