There is nothing wrong with JavaScript as a language beyond it's, originally questionable, foundations that have since been iterated upon (much like PHP).
As a massive fan of static typed languages. There is no denying that dynamic typed languages are more fun to develop with in smaller project. It just they often hit a tipping point when they become a horror to deal with. I can still remember my first legacy Python code based where everything was thrice nested dictionaries.