Since we're talking about javascript, I do have one case in which I find it actually helpful. Tree-sitter is a pretty promising piece of software, and you write the grammar in JS. The reason this works is because the only data types you're dealing with are nodes and strings, the latter of which get converted into nodes. Essentially, the type system doesn't come into play at all, and the flexibility of writing grammars is not insignificant. Having written parsers using bison, lark, ocaml, I have to say that as far as getting something going quickly, I kind of prefer TS, at least in the beginning. Add to that the fact that tree-sitter will build packages and shared object files for your grammar automatically, and the native integration with emacs, it's pretty solid.