Most critics of JavaScript don't know the good parts[1]. Sure, JavaScript has problems, but convention and static analysis fixes a lot of it. In addition, you can use something like TypeScript if you don't prefer dynamic typing. And it must be said that JavaScript does some things better than C++/C#/Java, e.g. functions. These languages are only now starting to catch up.
1. http://www.youtube.com/watch?v=hQVTIJBZook