Here is the code that I am using:
let myFirstPromise = new Promise((resolve, reject) => {
setTimeout(function(){
// alert("sdf");
resolve("Success!"); // Yay! Everything went well!
}, 200);
});
console.log(myFirstPromise);
Why does the logged value display like this:
but then when I open it, it shows resolved?
Another case, Lets say i change the 200 to 2000, now
- if i expand before 2 sec, it shows pending always, even if you expand again after 2 min.
- if i expand after 2 sec, it shows resolved, and same there after.
Is there a reason it is so ?