The location.host property is used to return the host IP address or domain and port of a URL. We can also set it in order to navigate the same URL but with a different host and port.
Its syntax is:- location.host OR location.host = host:port
Its return is:- string containing host IP address or domain and port number.
|host:port||The host and port number of the URL.|