JavaScript really isn't that slow. JIT compilation can wind up faster than AOT compilation. And much of the APIs called by JavaScript is natively-implemented browser code. JavaScript is faster than C# yet people implement games in C# (not the engine cores, but that's a very similar situation to JS) and don't bat an eye.