The replace() method of the Location interface replaces the current resource with the one at the provided URL.
replace()
MDN Reference