Javascript is used to add dynamics and effects to a webpage. Manipulate content (HTML & CSS), load data from remote servers and to build entire applications in the browser, which we call web apps.
Javascript is completely dynamic and is the language that the popular frameworks and libraries like React, Angular and Vue are built in. These libraries might go away but JavaScript won't so it's a good idea to have a good foundation of JavaScript itself.
JavaScript can also run outside of web browsers. For e.g It is possible to use JavaScript on the web server using a very popular technology called NodeJS which doesn't need any browser at all and this allows us to create backend applications which are simply applications that run on a web server and to interact with databases, ETC.
JavaScript has really changed the whole developement industry over the last couple of years, making things possible that has been really difficult. With the help of frameworks and libraries like Ionic, React Native, Electron, JavaScript can be used to build native mobile and desktop applications.
There has been a huge update to the JavaScript language in 2015 which is oficially called ES2015 but porpularly called ES6, because it was the update that came after ES5. Also new releases has been introduced after the ES6 update which encapsulates everything we call Modern JavaScript.
You can also use JavaScript to build native mobile applications as well as native desktop applications thanks to tools like React native, Ionic Framework and Electron.
Now you understand how powerful JavaScript is and what it is used for, let's move on to other stuff.