The Moddable JavaScript (ES2017) runtime[1] works great on ESP8266 and ESP32 microcontrollers as well.
[1] https://github.com/Moddable-OpenSource/moddable