These are the advantages of JavaScript:
Enhanced Interaction
JavaScript adds interaction to otherwise static web pages and makes them react to users’ inputs.
Quick Feedback
There is no need for a web page to reload when running JavaScript. For example, form input validation.
Rich User Interface
JavaScript helps in making the UI of web applications look and feel much better.
Frameworks
JavaScript has countless frameworks and libraries that are extensively used for developing web applications and games of all kinds.