What is the use of JavaScriptExecutor in Selenium?

What is the use of JavaScriptExecutor in Selenium?

JavascriptExecutor is an interface for running JavaScript with Selenium. Consider JavascriptExecutor in Selenium as a mechanism that allows the WebDriver to interact with HTML components within the browser.