I’m digging into jQuery’s deferred features. I’ve tried several examples on the internet. I understood its concept, but I don’t understand the difference between resolve() and promise().
What are differences between resolve() and promise()?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Both
resolve()andpromise()are methods on the jQueryDeferredobject.First a snippet from the jQuery documentation about Deferred:
With that in mind,
promise()returns an object that is very similar to theDeferredobject except that it only hasthen(),done(), andfail()methods and does not haveresolve()orreject().From the blog post m-sharp referred to regarding
promise():