I don't think that compiling JS to wasm is possible currently.
Effective compilation requires GC at least, and that Wasm extension proposal is still under development. It's also not clear if a proposal like that would be incorporated into Substrate since it ultimately depends on how it will work.
Then there are inherent problems with compiling a dynamic language such as JS ahead-of-time. This is especially so when targeting Wasm.