为什么它打印promisepending?
我期待它可能会给出承诺
let k = new Promise((resolve, reject) => {
let a = new Promise((res, rej) => {
res(1);
});
resolve(a);
});
console.log(k); // see browser console for promise state
如果你等到承诺得到解决,这会有所帮助
let k = new Promise((resolve, reject) => {
let a = new Promise((res, rej) => {
res("boink");
});
resolve(a)
});
k.then(res => console.log(res))