typescript什么时候支持es6?

map、set都不用永for of遍历,看到jsconfig.json配置都支持es6了,怎么ts的还不支持es6呢?

1赞

不是已经支持了吗

不支持,你自用用ts试试map遍历,绝对错误

但是我一直在用async/await啊

weakset 不能遍历,set 应该没问题

支持了不知道多久了。。。你使用姿势不对

我這邊也試不出for of map遍歷,能請教您的設置嗎?感謝

需要设置 tsconfig.json 中的 lib 属性

我也用,很好用,但数组有些方法还不不支持,报错,比如findIndex

{
  "compilerOptions": {
    "module": "commonjs",
    "lib": [ "dom", "es6", "es2015" ],
    "target": "es5",
    "downlevelIteration": true,
    "allowJs": true,
    "experimentalDecorators": true,
    "skipLibCheck": true,
  },
  "exclude": [
    "node_modules",
    "library",
    "local",
    "temp",
    "build",
    "settings"
  ]
}

這是我目前的設置, 但仍無法for of map遍歷,
cocos creator版本2.0.9,
求助

同问, 为啥map不能遍历啊