Can we use XPath in JavaScriptExecutor?

Is it possible to use XPath in JavaScriptExecutor?

Locators such as XPath, CSS, and others are used in Selenium Webdriver to identify and conduct actions on a web page. If none of these locators work, you can try JavaScriptExecutor.