Suppose some code does
// promise.js
let p = new Promise(() => { /* ... */ })
export default p
where Promise
is an ES6 Promise. Suppose some other code has a reference only to p
. How can that code tell if p
is resolved or not?
// other.js
import p from './promise.js'
// console.log('p is resolved?', ______)
Is there something we can fill in the blank with that would show true or false depending on whether the promise is resolved or not?