Let’s look at an example
Here we have a basic promise, for which we know it will be resolved, as
1 === 1 is true and we can display the result. But if we change the condition to
1 !== 1, the promise becomes rejected.
See the Pen Promises – basics by 22nds (@22nds) on CodePen.0
See the Pen Promises for Fetch by 22nds (@22nds) on CodePen.0