What is JavaScriptExecutor in Java?

What is JavaScriptExecutor in Java?

JavaScriptExecutor is an interface that allows Javascript to be executed using the Selenium driver. It has methods “executescript” and “executeAsyncScript” for running JavaScript in the context of the currently chosen frame or window.