The browser, instead of downloading javascript, downloads WASM bytecode, and this bytecode gets compiled ahead-of-time to machine language and ran by the browser.
The bytecode itself is the product of compiling a source code written in the language of your choice, for example Java or something more advanced like INTERCAL.