TypeError: Promise resolver undefined is not a function 1

TypeError: Promise resolver undefined is not a function

// Instead of this
const promise = new Promise()

// do this
const promise = new Promise(() => {})  

Here is what the above code is Doing:
1. We create a new promise.
2. We pass a function to the promise.
3. The function is called with two arguments: resolve and reject.
4. We call resolve() if the promise is successful.
5. We call reject() if the promise is unsuccessful.

Similar Posts