JavaScript is a scripting language used both on the client-side and server-side that enables you to implement complex features on web pages and to make them interactively.
If a web page does more than displaying static information - showing timely content updates, interactive maps, animated graphics, scrolling video jukeboxes, etc. then javascript is used in that.
If you are looking for online courses to learn web development from top instructors, you can check out these Web Development Courses by Intellipaat.
You can check this YouTube tutorial to get started: