// Get parameters from a URL:

const url = new URL('https://example.com/index.php?name=David&surname=Adams');
console.log(url.searchParams.get('name')); // David 
console.log(url.searchParams.get('surname')); // Adams


// Redirect URL

location.href = "https://codeshack.io";

// Redirect in 10 seconds:

setTimeout(() => location.href = "https://codeshack.io", 10000); 


// Get Hash Value

// URL: http://example.com/home#MyProfile
console.log(window.location.hash.substr(1)); // Output: MyProfile