admin管理员组文章数量:1335138
I have an async function declaration that works on Chrome and Firefox, but gives the following error in internet explorer.
SCRIPT1004: Expected ';'
File: javascriptFile.js, Line: 5, Column 7
This is the simplified version with these two function at the top of the file, and it still fails on internet explorer.
function sleep (ms) {
return new Promise(function (resolve) { setTimeout(resolve, ms) })
}
async function begging (help) {
await sleep(1000)
console.log('please')
}
I can not seem to find anything about not being able to declare async functions in internet explorer. I would really appreciate any help at all, I'm not sure where to look next in order to figure this out.
I have an async function declaration that works on Chrome and Firefox, but gives the following error in internet explorer.
SCRIPT1004: Expected ';'
File: javascriptFile.js, Line: 5, Column 7
This is the simplified version with these two function at the top of the file, and it still fails on internet explorer.
function sleep (ms) {
return new Promise(function (resolve) { setTimeout(resolve, ms) })
}
async function begging (help) {
await sleep(1000)
console.log('please')
}
I can not seem to find anything about not being able to declare async functions in internet explorer. I would really appreciate any help at all, I'm not sure where to look next in order to figure this out.
Share asked Aug 14, 2017 at 19:01 Struggle_BusStruggle_Bus 231 silver badge3 bronze badges 01 Answer
Reset to default 8Internet Explorer does not support async
functions, and never natively will. The main drawback of using new JavaScript features is lack of support.
本文标签: javascriptasync function declaration expects 3939 in Internet ExplorerStack Overflow
版权声明:本文标题:javascript - async function declaration expects ';' in Internet Explorer - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742264234a2443085.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论