Welcome to the Treehouse Community
Looking to learn something new?
Are promises usually wrote within if and else statements, giving the code either the green or red light?
Thanks if anyone can clarify, the concept is a little tricky to grasp in my head.
Steven Parker220,574 Points
Yes, this concept is one of the trickier ones for sure. The promise itself is an object that represents some asynchronous process that may be currently still pending or has completed. The "then" and "catch" methods allow you to register fulfillment handlers.
There's more explanation on this MDN documenation page, along with a little demo which may help to make things clearer.