Integrate https://babeljs.io/ to be able to use newer Javascript featues while still being compatible with older browsers. An additional step needs to be added to https://opengrok.libreoffice.org/xref/online/loleaflet/Makefile.am (probably before the uglifyjs call).
Once this is done, obvious next-step easy hack is adding more modern JS features