When or who does pass resolve and reject functions to JS promises?

后端 未结 5 1614
无人共我
无人共我 2021-01-12 11:52

I have begin learning javascript promises. But I just can\'t understand the concept of promises. The thing that bothers me most is who is passing the Resolver and Reject fun

5条回答
  •  执念已碎
    2021-01-12 12:30

    The thing that bothers me most is who is passing the Resolver and Reject function to a promise constructor ?

    Nobody.

    The functions are passed by the promise constructor.

    They as passed to the function you pass as the first argument to the promise constructor.

提交回复
热议问题