gpt4 book ai didi

TypeScript 目标 ES3

转载 作者:搜寻专家 更新时间:2023-10-30 21:22:37 29 4
gpt4 key购买 nike

Array.prototype.indexOfDate.now 已在 ES5 中引入。如果我编译存储在文件 test.ts 中的以下代码,为什么 Typescript 不能转译?

Date.now();
[1,2,3].indexOf(2);

我使用的命令是 tsc -t es3 test.ts。生成的 test.js 与 test.ts 完全相同。

最佳答案

Why doesn't Typescript transpile, if I compile following code stored in file test.ts?

  • TypeScript 不会 polyfill。
  • 使用 corejs 填充

更多

关于TypeScript 目标 ES3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47823338/

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