skellertor
skellertor

Reputation: 1105

`String.prototype.at` is not implemented in all browsers. Is there a @babel/plugin that will transform this down to ES5 javascript?

At the time of this question String.prototype.at is not implemented in all browsers.

I would like to use the at function on the String prototype within a React app that uses babel to transform modern ecmascript into older more browser compatible versions of javascript.

I have been unsuccessful in finding a babel plugin that would do this for me.

Is there a @babel/plugin that will transform the String prototype at function down to more browser compatible ES5 javascript?

Upvotes: 0

Views: 282

Answers (1)

Lionel Rowe
Lionel Rowe

Reputation: 5926

Babel is for syntax-level transformations, not browser API polyfills.

You can consider using a polyfill service like Polyfill.io, or alternatively, simply use the polyfill code from the relevant proposal.

Upvotes: 0

Related Questions