打字稿目标 ES3

rai*_*amp 4 typescript tsc

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

Date.now();
[1,2,3].indexOf(2);
Run Code Online (Sandbox Code Playgroud)

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

bas*_*rat 7

如果我编译存储在文件 test.ts 中的以下代码,为什么 Typescript 不转译?

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

更多的