JavaScript is used on almost every modern website, and it has a wide array of applications. For instance, the “Print” link directly above this paragraph of text uses JavaScript to tell the browser to display a print dialog when it is clicked. If you click on a link to another page on WP Glossary, the site uses JavaScript to load the contents of that page without forcing your browser to do a hard reload.
Those are two examples of pretty simple uses of JavaScript. The development of new libraries built on top of the language, like Vue and React, has made it possible to build increasingly complex systems with JavaScript at their core. The latter of the two libraries, React, is developed by Facebook, and they use it for almost all of the front-end interactions on Facebook.com. React is also the backbone of the new editing experience in WordPress: Gutenberg.
As a user of WordPress, you will probably not have any direct interactions with JavaScript, but it is one of the core technologies on top of which WordPress is built.