The location object provides information about the current URL and methods to change it.
console.log(location.href); // Full URL
console.log(location.pathname); // "/products"
console.log(location.search); // "?id=123"
console.log(location.hash); // "#section"
location.href = "https://example.com"; // Go to URL