The port property of a WorkerLocation object returns the URL.port part of the worker's location.
port
MDN Reference