When a ``++Promise++`` needs to only "resolve" or "reject", it's more efficient and readable to use the methods specially created for such use cases: ``++Promise.resolve(value)++`` and ``++Promise.reject(error)++``.


== Noncompliant Code Example

[source,javascript]
----
let fulfilledPromise = new Promise(resolve => resolve(42));
let rejectedPromise = new Promise(function(resolve, reject) { 
  reject('fail');
});
----


== Compliant Solution

[source,javascript]
----
let fulfilledPromise = Promise.resolve(42);
let rejectedPromise = Promise.reject('fail');
----

ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::message.adoc[]

include::highlighting.adoc[]

endif::env-github,rspecator-view[]
