Quick Answer
.promise() on a jQuery collection returns a Promise that resolves when all queued effects on the elements complete. $("div").fadeIn(500).promise().done(function() { console.log("all faded in") }). .done() attaches a callback to a Deferred - fires when resolved. Together they enable "do this after all animations complete" without counting callbacks manually.
Answer
.promise() returns a deferred tied to queued animations. .done() executes after all animations finish. Useful for synchronizing multiple effects.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.