It's hard to compare JS to Haskell without mentioning the JS's complete lack of a type system...
That said, if you want something more ML-like in your JS, Flow is an increasingly-viable option: https://flowtype.org/
That said, if you want something more ML-like in your JS, Flow is an increasingly-viable option: https://flowtype.org/
What does this mysterious assertion mean?