If you want to redirect to another webpage in JavaScript, you can use the following methods:

Method 1: Redirect to Another Webpage Using window.location

window.location = "https://www.example.com";

Method 2: Redirect to Another Webpage Using window.location.href

window.location.href = "https://www.example.com";

Method 3: Redirect to Another Webpage Using window.location.replace

window.location.replace("https://www.example.com");

Method 4: Redirect to Another Webpage Using window.location.assign

window.location.assign("https://www.example.com");

Method 5: Redirect to Another Webpage Using window.location.replace

window.location.replace("https://www.example.com");