I want to know what is the difference between location.replace() and location.assign() .
location.replace()
location.assign()
I watched carefully, but I did not notice any difference between the two.
location.replace() goes to the page with the argument, replacing the current page in the story.
location.assign() goes to the page with the argument, adding a new element to the story.
https://developer.mozilla.org/En/Window.location
From MDN to replace() :
replace()
Replace the current document with the one indicated at the specified URL. The difference from the assign () method is that after using replace () the current page will not be saved in the session history, that is, the user will not be able to use the "Back" button to go to it.