JavaScript is a programming language that allows your pages to "do" things or become interactive.There are a lot of definitions out there for JavaScript but like so many other things with JavaScript; they are as different as night and day
JavaScript is used for everything from creating simple web apps, to querying information from other sites to add to your page for things like weather apps, news, calanders etc...
JavaScript is easily the most misunderstood and convoluted language out there beause there is so much misinformation about it. Learn from good sources and learn good practices and the web will be yours!!
JavaScript is used mainly to add interactivity to web pages and is one of the most popular programming language out there. However, it can be used for many things. From simple on the fly changes all the way to server side languages. JavaScript can be used.
Be very careful where you go to learn JavaScript because there are many out there that will not teach you to code properly.
JavaScript can just about do anything in one form or another
Just know that learning JavaScript will take some time. Just keep at it and you'll get it. Stay with good communities and reputable people that can be trusted in the way the do things. There are a lot of people out there who call themselves web developers that only use Word press or other content managers who will lead you astray because they ar not "actual developers"but just page creators who want to "look" well informed so they can charge high dollar prices for the cookie cutter pages tey create.
Do the work and cover the material and before you know it you'll be creating sites from scratch and apps from scratch that will be functional and make the world a better place