What is the purpose of
replace() methods of
A history instance has two methods for navigation purpose.
If you think of the history as an array of visited locations,
push() will add a new location to the array and
replace() will replace the current location in the array with the new one.