How to use JavaScriptExecutor in selenium WebDriver?

How to use JavaScriptExecutor in selenium WebDriver?