1 points · by thinkloop · 7y ago · 1 comment
const result = await doAsync();
We could have a method on the returned Promise object called 'await':
const result = doAsync().await();
2) `await` can work with anything that conforms to the Promise spec, native promises or Bluebird or what have you.
3) Sometimes, a method doesn't return a Promise, but a value. In those cases, the await syntax returns the value. Can't do that with a method.