While on the topic of amazing things people have done with JavaScript (WASM), check this out!
Yes, it is a whole Linux distro running right there in your web browser.
See the list of operating systems here - there is also Windows and DOS, and both graphical and console only systems.
That's not the only one, there's also https://webvm.io/ from the people who made a Java to WASM compiler, you can even convert old Java applets to JS!
In fact they have a whole bunch of neat tools, it's worth exploring around. Live Java REPL?
So you can have an operating system, how about an OS running in a container, running in a web browser?
https://ktock.github.io/container2wasm-demo/
container2wasm is a container-to-wasm image converter that enables to run the container on WASM.
Converts a container to WASM with emulation by Bochs (for x86_64 containers), TinyEMU (for riscv64 containers) and QEMU.
Runs on WASI runtimes (e.g. wasmtime, wamr, wasmer, wasmedge, wazero)
Runs on browser
x86_64, riscv64 or AArch64 containers are recommended.
Hmmm this one has apt ... wonder if I can install docker in a wasm container in an emulated linux running in a browser ...
Not enough for you?
Whole honking massive list here of alternatives for you to launch and play with ...