gpt4 book ai didi

javascript - chrome/chromium 44 中的解构语句未被识别

转载 作者:行者123 更新时间:2023-11-28 19:03:57 25 4
gpt4 key购买 nike

据我所知,这是有效的 EcmaScript6:

let obj = {foo: "foo", bar: "bar"}; 
let {foo, bar} = obj; // <- Syntax error here

Firefox 可以正常运行此代码,但 Google Chrome 和 Chromium 都会给出此错误:

Uncaught SyntaxError: Unexpected token {

我知道在 Firefox 中,脚本标签必须在 type 属性中标记为“version=1.7”才能正常工作,但在 Google Chrome 中,这会导致脚本被忽略。正常的脚本标签会出现此错误。

这是否意味着 Google Chrome 中未实现此功能?或者我错过了什么?

最佳答案

关于javascript - chrome/chromium 44 中的解构语句未被识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32045775/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com