I think "all of Ocaml compiles to JS " is a bit optimistic. AFAIK, code using Jane Street's Core stdlib doesn't work. But a lot of Ocaml code should be fine.
All of the core compiler library does compile to efficient JavaScript. For instance, see the IOCamlJS interactive notebooks that embed the entire compiler in the browser with a web UI. Just press the play button: