In which cases JavaScriptExecutor will help in Selenium automation?

In which cases JavaScriptExecutor will help in Selenium automation?

JavaScript executor is a Selenium WebDriver interface that has functionality similar to Java Script and can interact with HTML DOM elements.

Rather than using a driver ,one can use the JavaScriptExecutor Interface to perform similar actions on the Page as the Selenium WebDriver’s findElement method.