Loading problem…
Implement a Promise constructor from scratch that follows the Promise/A+ specification. This is the foundation for all Promise methods.
Create a MyPromise class that behaves like the native Promise constructor, supporting:
then method for chainingcatch method for error handlingfinally method for cleanup(resolve, reject) => {}pending, fulfilled, rejectedonFulfilled and onRejected callbackscatch and finally methodsqueueMicrotask or setTimeout as fallback