News for hackers. Stuff that matters.
Re:JavaScript async/await implemented in V8 by neoeldex on Tuesday May 17, 2016 @08:23AM (#11712973)
fetch() returns a promise, which is unwrapped using await. fetch's promise contains a response object, which has a json method, which returns a promise.

  const responsePromise = fetch(https://api.github.com/orgs/facebook');
  const response = await responsePromise;
  const jsonPromise = response.json();
  const json = await jsonPromise;

There are no comments on this comment yet.