Creating a resolvable Promise just got cleaner 🧹
`Promise.withResolvers()` returns { promise, resolve, reject }
No more wrapping logic inside the constructor.
Learn more 👇
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
MDN Web Docs
@mdn@mastodon.social
The official MDN Web Docs account. We deliver the best web docs around. Visit → https://mdn.dev Contribute → https://mdn.dev/community
mastodon.social
MDN Web Docs
@mdn@mastodon.social
The official MDN Web Docs account. We deliver the best web docs around. Visit → https://mdn.dev Contribute → https://mdn.dev/community
mastodon.social
@mdn@mastodon.social
·
Mar 08, 2026
9
0
8
Loading comments...