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?
Asked
Active
Viewed 176 times
1
-
There is not a huge difference in the ECMA-2021 vs the ECMA-2019 version. Have you tested just running your code on your devices? Usually it's just very few things the console might complain about that can easily be fixed manually (depending on the size of your code base) – Aram Becker Sep 10 '21 at 15:28
-
babel + core-js, but your request sounds a bit weird, what devices are these, and what features of ES2021 do you really use? Also, requests for a tool/library are theoretically OT here. – ASDFGerte Sep 10 '21 at 15:28
-
@ASDFGerte I have an iPhone 6 with Safari 12.1. It doesn't support ESMA 12 but, It does support ESMA 10. I don't know what features of ESMA 12 I use. The script was perfectly working on chrome on my laptop and suddenly in safari, it doesn't work. I didn't know that this question was off-topic, sorry. Where should I ask this type of question? – Random Kindle Sep 10 '21 at 16:48
1 Answers
2
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.

samanime
- 25,408
- 15
- 90
- 139