// In a Web worker, on the page https://developer.mozilla.org/en-US/docs/Web/API/WorkerLocation/hash#examples
const result = location.hash; // Returns '#examples'WorkerLocation: hash property / notebook
WorkerLocation: hash property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.