Javascript is the VB6 of the 2010's
Just because something is popular does not mean that is better. Javascript does have some strengths (closures) that make it attractive for some uses, but in general Javascript has a number of big nuances that make it unsuitable for projects that require long term maintenance or are of significant complexity. It is, like VB6, extremely accessible and supported by a wide ecosystem of tools and technologies. But it does not have long term future (long term like C, C++ or Perl)
Javascript was created out of the desire to make web pages dynamic and have a low learning barrier, not as a system level, server level or any kind of serious usage.
My biggest pet peeves: lack of proper modularization and scoping at higher levels, lack of proper multithreading constructs and being typeless. The first prevents any serious development of components, the second any serious system level development and the third prevents any serious large scale systems. And by serious I mean robust enough to withstand the test of time.
None of that means that it can't be done in Javascript, just means that it will take way more time and effort than doing it than with some other alternative. Yes, there are some large JS component libraries (jQuery), some dare to write server side (Node.js), and even some attempt to write Office like apps (Google Docs) But all these suffer from problems of stability, integration, performance and pale in front of rivals created in other languages better designed.
And also none of that matters in the web world, where (a) Javascript is the only universally available client side language so you don't have anything else to choose and (b) the most common course of action is to rewrite things from scratch from time to time. But trying to make an argument from this about JS being good outside client side web pages is... plain wrong.
And don't even get me started in PHP....