JS is one of the most un-opinionated, flexible language around, I do not believe there is
a one true way™ of doing JS. For example, React and Angular have very different approaches (functional vs OPP) on how to JS.
I do agree that having something do a different thing depending on where and when can be counter-intuitive.