The Promise object is used for deferred and asynchronous computations. A Promise is in one of four states:

  1. pending: initial state, not fulfilled or rejected.
  2. fulfilled: successful operation.
  3. rejected: failed operation.
  4. settled: fulfilled or rejected

This demo gets a 'news feed' (see below) from data/feed.json using XHR.

There's more information about JavaScript Promises in Jake Archibald's article on HTML5 Rocks.

View source on GitHub