JQuery when() method

This JQuery.when() method in JQuery  gives a way to execute callback functions depending on zero or more Thenable objects, which usually are Deferred objects that represent asynchronous events.

Syntax:

jQuery.when(deferreds)

    Parameters:

  • deferreds: This parameter specifies zero or more Thenable objects.

Return Value: This method returns a Promise.

There are two examples discussed below: