多项选择题
A./函数声明async functionfoo(){}
B./函数表达式const foo=async function(){};
C./对象的方法let obj={asyncfoo(){}};obj.foo().then(...)
D./箭头函数const foo=async()=>{};
多项选择题 针对代码:async function getTitle(url) { let response = await fetch(url); let html = await response.text(); return html.match(/<title>([\s\S]+)/i)[1];}getTitle(‘https://tc39.github.io/ecma262/’).then(console.log)// “ECMAScript 2017 Language Specification”说法正确的是()
多项选择题 async function f() { try { await Promise.reject(‘出错了’); } catch(e) { } return await Promise.resolve(‘hello world’);}f().then(v => console.log(v))代码是执行正确的是()
多项选择题 async function f() { await new Promise(function (resolve, reject) { throw new Error(‘出错了’); });}f().then(v => console.log(v)).catch(e => console.log(e))()