编辑代码

//简单的异步方法
async function getTitle(url) {
  let response = await fetch(url);//抓取网页
  let html = await response.text();//取出文本
  return html.match(/<title>([\s\S]+)<\/title>/i)[1];//匹配页面标题
}
getTitle('http://js.jsrun.net/').then(console.log).catch(console.log);
console.log(11111);