Here is how to use a Promise: Promise.then () takes two arguments, a callback for success and another for failure. Both are optional, so you can add a callback for success or failure only. To demonstrate the use of promises, we will use the callback examples from the previous chapter: More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.