For example var r = await fetch(url);
Is reeponse returned? r receives response; right
怪我咯2017-05-19 10:19:28
Return resolved value. In your example, it is a correct response (2xx).
try {
var r = await fetch(url);
} catch(e) {
console.error(e);
}
catch
Capture the reject value, which is an exception.
PHP中文网2017-05-19 10:19:28
expression is a Promise, resolved, returns the resolved value; rejected, throws an exception.
Not a Promise, returns a resolved Promise.
await-mdn