JavaScript window location replace method enables you to change the current URL location with new location URL that redirects the current page to new specified web page. JavaScript location object belongs to JavaScript window object that allows you to access the replace method using window.location.replace. You can also access the replace method directly as location.replace.
Try the sample below to learn and practice the code functionality of JavaScript window location replace method: