我遇到TypeError:Promise.allSettled在节点js中运行promise.allSettled函数时不是函数。请让我知道解决方案
const promise1 = Promise.resolve(3);
const promise2 = new Promise((resolve, reject) => setTimeout(reject, 100, 'foo'));
const promises = [promise1, promise2];
Promise.allSettled(promises).
then((results) => results.forEach((result) => console.log(result.status)));