With the help of the `host` property, we can get or set the host name and the port number of the currently loaded document.
Location host Property Syntax:
location.host location.host = “new location”;
Example: document location hostname
const value = location.host; console.log(value);