JavaScript is known as the "language of the web", which is a not-so-subtle way of touting its usefulness to anything that runs on the web. What makes it so useful? And why do 90% of websites use JavaScript?
Interactivity
Yep. Pretty much this. The web before JavaScript was a desolate wasteland of one page wesbsites filled with keywords and no real thought to design or user experience. JavaScript changed all that.
Now, in Web 2.0, as the web is now called (snooze.), virtually every website includes JavaScript to allow users to sign up for emails, click through photo galleries, play games and much, much more.
It's good for developers, too.
In addition to all the benefits for users, JavaScript is also a powerful language for developers. It is a true object-oriented language, which simply means we can create powerful functions that utilize a defined set of variables. These variables are often set by user input or user actions, which gives these pages and apps their interactivity.
So that's it?
Nope.
Oh.
JavaScript has a very active community and several libraries have been developed to supplement it. Many modern websites take advantage of jQuery, which is a light weight library that adds really cool interactions. Other libraries that are gaining a lot of steam are Node, Angular and Bakcbone, all of which communicate with servers.
This is a departure from traditional JavaScript because normal JavaSCript allows for user interaction. However these "server-side" libraries allow developers to accomplish the same type of functionality as a traditional server-side language like PHP, Ruby or Java, but with a fraction of the code, improving the site's performance.