How to convert ECMAScript 12 to ECMAScript 10

288 Views Asked by At

I wrote a JS File, some of the codes in it are in ECMAScript 12. The problem is all my devices support only ECMAScript 10. This was the file Javascript Is there any online converters available, or how can I do it manually?

1

There are 1 best solutions below

0
On BEST ANSWER

You're looking for Babel.

Babel will basically let you write modern JS code and then it can transpile it to "more primitive" code in order to run on a larger set of devices.

There are a bunch of options and a bunch of ways you can go about using it, but using the env preset and specifying your targets is probably a good place to start.