This translation is incomplete. Please help translate this article from English

The host property of the URL interface is a USVString containing the host, that is the hostname, and then, if the port of the URL is nonempty, a ':', followed by the port of the URL.

Nota: Esta característica está disponible en Web Workers.


const host = = newHost


A USVString.


let url = new URL('');
console.log(; // ""

url = new URL('');
console.log(; // ""
// The port number is not included because 443 is the scheme's default port

url = new URL('');
console.log(; // ""


Specification Status Comment
La definición de '' en esta especificación.
Living Standard Initial definition

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome para AndroidFirefox para AndroidOpera para AndroidSafari en iOSSamsung Internet
hostChrome Soporte completo SiEdge Soporte completo 13Firefox Soporte completo 22IE Sin soporte NoOpera Soporte completo SiSafari Soporte completo SiWebView Android Soporte completo SiChrome Android Soporte completo SiFirefox Android Soporte completo 22Opera Android Soporte completo SiSafari iOS Soporte completo SiSamsung Internet Android Soporte completo Si


Soporte completo  
Soporte completo
Sin soporte  
Sin soporte

See also

  • The URL interface it belongs to.