# deferred.always()

## deferred.always ( alwaysCallbacks, alwaysCallbacks ) Returns: Deferred version added: 1.6

- alwaysCallbacks
  Type: Function
  A function, or array of functions, that is called when the Deferred is resolved or rejected.

- alwaysCallbacks
  Type: Function
  Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.

Description: Add handlers to be called when the Deferred object is either resolved or rejected.

The argument can be either a single function or an array of functions. When the Deferred is resolved or rejected, the `alwaysCallbacks` are called. Since `deferred.always()` returns the Deferred object, other methods of the Deferred object can be chained to this one, including additional `.always()` methods. When the Deferred is resolved or rejected, callbacks are executed in the order they were added, using the arguments provided to the `resolve`, `reject`, `resolveWith` or `rejectWith` method calls. For more information, see the documentation for Deferred object.

## Examples:

#### Example: Since the jQuery.get() method returns a jqXHR object, which is derived from a Deferred object, we can attach a callback for both success and error using the deferred.always() method.

    $.get( "test.php" ).always(function() {
      alert( "$.get completed with success or error callback arguments" );
    });