It was born at the same time as webgl, at the time of Jit optimisation for js engines. As a subset of js first, then as wasm as we know it. It was originally for games and performance on the web.
At no point there was a conversation about "replacing js", but more like, "js can't do these stuff. let's have something else".