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中聲明異步函數。我真的很感激任何幫助,我不知道下一步看什麼,以便弄清楚。