One important aspect of babel-preset-env I think you missed: Browser Polyfills. TypeScript can transpile syntax down for older browsers, but it won't add runtime code to support something like String.prototype.replaceAll() in IE11
I've noticed in TypeScript playground, when you write code that contains newer features of JS and set the target to something like ES5, the tsc will produce code that seems to be polyfilled. Why do you say that it doesn't do runtime polyfilling?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
One important aspect of babel-preset-env I think you missed: Browser Polyfills. TypeScript can transpile syntax down for older browsers, but it won't add runtime code to support something like String.prototype.replaceAll() in IE11
Indeed, I will update the post this weekend to add this point 👍
I thought that TypeScript added polyfills, but it doesn't and adding them is not trivial either.
Thanks !
I've noticed in TypeScript playground, when you write code that contains newer features of JS and set the target to something like ES5, the
tscwill produce code that seems to be polyfilled. Why do you say that it doesn't do runtime polyfilling?