JavaScript Window location.port
JavaScript Window location.port
The location.port property is used to either set or return the port number of a URL. If the default port is 80(http) or 443(https), then most browsers will return an empty string.
Syntax:-
Its syntax is:- location.port OR location.port = port
Return:-
Its return is:- a string containing port number of current URL
Further Explanation:-
Parameter | Description |
port | The port number of the URL. |