It can used as an intermediate language, and since it was the only way to run code on the browser without plugins before WASM, it happened a lot.
But nowadays WASM is much more suitable for the job. JavaScript was designed as a scripting language, not a low level intermediary language.