0
Array.prototype.indexOf
및 Date.now
이 ES5에 도입되었습니다. test.ts 파일에 저장된 코드를 컴파일하면 왜 Typescript가 표시되지 않습니까?TypeScript 대상 ES3
Date.now();
[1,2,3].indexOf(2);
내가 사용하는 명령은 tsc -t es3 test.ts
입니다. 결과로 나오는 test.js는 test.ts와 완전히 동일합니다.
[타이프하지 않습니다 polyfill] (https://github.com/Microsoft/TypeScript/issues/6468 # issuecomment-171400551) 바벨처럼. – jcalz
바벨은 polyfill하지 않습니다. Babel *은 Polyfill (본질적으로 core-js)을 사용합니다.이 유형은 TypeScript에서도 사용할 수 있습니다 – basarat