History API provides us some useful methods which are used to manipulate the browser history stack.
replaceState() method accepts three arguments which are
url by using these arguments it updates the url without reloading the page.
data: It is an object where we can store some data related to that url.
title: It contains data related to the title of the webpage.
url : The url you need to add.
Similarly, we can use the
pushState() method which also works same like
replaceMethod() but the
pushState() method creates the new entry into the history stack instead of replacing the old entry.