How do I compile C++ to JavaScript in a browser?
In theory, it may be possible to develop a self-hosting version of Emscripten that runs in a browser, though this hasn’t been done yet. Alternatively, it is possible to run a C++ compiler (or even an entire operating system) using an x86 emulator in JavaScript.