jQuery Deferred .promise() method

This .promise() method in JQuery Returns a Promise object to be observed when certain type actions bounded to the collection, queued or not, are ended.

Syntax:

.promise([type][, target])

    Parameters:

  • type: This parameter specifies the type of queue which needed to be observed.
  • target: This parameter specifies Object onto which the promise methods need to be attached.

Return Value: This method returns a dynamically generated Promise which is resolved once actions bounded to the collection, queued or not, have finished.

There are two examples discussed below: