1
我有一个适用于Chrome和Firefox的异步函数声明,但在Internet Explorer中出现以下错误。异步函数声明期望';'在Internet Explorer中
SCRIPT1004:预期';'
文件:javascriptFile.js,行:5,列7
这是简化的版本在文件的顶部这两个功能,它仍然无法在Internet Explorer。
function sleep (ms) {
return new Promise(function (resolve) { setTimeout(resolve, ms) })
}
async function begging (help) {
await sleep(1000)
console.log('please')
}
我似乎无法找到任何关于不能够在Internet Explorer中声明异步函数。我真的很感激任何帮助,我不知道下一步看什么,以便弄清楚。