Misc Deferred Rejectwith
# jQuery deferred.rejectWith() Method
[jQuery Misc Methods](#)
* * *
## Definition and Usage
The deferred.rejectWith() function is used to reject a Deferred object and invoke any failCallbacks callbacks with the given context and args parameters.
**Note:** 1. Typically, only the creator of the Deferred object can call this method. You can prevent other code from changing the state or reporting the status of the Deferred object by calling deferred.promise(), which returns a restricted Promise object.
2. When the Deferred object is rejected, any failCallbacks added via deferred.then or deferred.fail will be invoked. The callbacks are executed in the order they were added. The args parameter passed to deferred.reject() will be passed to each callback. Once the Deferred object enters the rejected state, any failCallbacks added will be executed immediately, with the parameters passed to .reject().
* * *
## Syntax
deferred.rejectWith( context [, args ] )
| Parameter | Description |
| :--- | :--- |
| _context_ | Object Type - The object to use as the this object when invoking the failCallbacks |
| _args_ | Array Type - An optional array of arguments to pass to the failCallbacks |
* * jQuery Misc Methods](#)
YouTip