I think static vs. loosely typed both have their pros and cons but that's the thing that's great about the Javascript community. It's not opinionated on things like this. So if you want statically typed, then you can code in Typescript.
This is in contrast to something like Rails which is super opinionated and doesn't give you much of a choice if you as a developer or even as a company as a whole were to disagree with these opinions.
Also rails is not a language, it is a framework, aka an opinion. Languages should lean towards being opinion agnostic while frameworks by there very nature should be opinionated.
The holy grail is a language that enforces guidelines itself, for example: a type system.