JavaScript Promise.reject()

Definition and usage

Promise.reject() The method returns a rejected Promise object with the specified value as the rejection value.

Example

Promise.reject("Not allowed");

Try it yourself

Syntax

Promise.reject(message)

Parameters

Parameters Description
message Used as the parameter for the rejection value.

Return value

Type Description
Object New Promise object.

Browser support

Promise.reject() is a feature of ECMAScript 6 (ES6).

Since June 2017, ES6 (JavaScript 2015) has been supported in all modern browsers:

Chrome Edge Firefox Safari Opera
Chrome 51 Edge 15 Firefox 54 Safari 10 Opera 38
May 2016 April 2017 June 2017 September 2016 June 2016

Promise.reject() Internet Explorer is not supported.