Javascript is a language that was never really designed, and many APIs were tacked on without any thought to the entire whole. It's a bit of a trash heap.
It's gotten better over the years as the responsible parties have started talking to each other and planning things out, but there are certain things that will hunt us forever (such as the distinction between optional and nullable with undefined and null).
I'm hoping that the interface for WASM gains more direct integration with the browser APIs so I can step away from javascript and write more things in Rust and other supported languages.