You can create a new Promise using the Promise constructor. It takes a function with resolve and reject parameters, representing success and failure, respectively.
javascript
Sharethis question
Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.