Javascript has been originally developed as scripting language for the Netscape browser. Nowadays it is standard to build interactive frontend applications and dynamic and scalable webservices. Javascript has also become an excellent option to develop hybrid and native mobile applications.
Javascript can interact with the server and the user. Content can be loaded dynamically.
Wth widgets tools are injected via Javascript into a website without having to add much code to it. And user input can be handled. For example
form fields can be validated before the form gets sent to the server to create a better user experience.
Motion design is trendy. Since Flash died out, whenever you see something moving and reacting on you, it is done with Javascript.
Javascript also provides excellent frameworks to create charts and other visualizations.
When applications became undeniably more complex in the frontend, the rise of Javascript client-side frameworks began. Backbone, Ember, Angular, React, Vue, just to name a view, provide different approaches to one goal: Have more control and architecture in the interface.
With the improving performance of javascript interpreters, developers started using javascript also in the backend.
This has the theoretical advantage of using only one language and potentially sharing code in frontend and backend. However, in reality this is not a good
reason to decide.
source: builtwith.com
We mainly use Javascript in the frontend of webapplications or mobile apps.
For certain use-cases we would also build APIs in NodeJS. In the frontend we focus on pragmatic decisions and that often means Vanilla JS or simply JQuery.
But for larger applications we work with any modern Javascript framework such as React or Angular.