I've found 5 different ways to change current location on a webpage. Which one's better and way are they all needed?
This is basically what I found:
window.location.assign("www.example.com")
does the same as
window.replace("www.example.com")
the difference is that replace() removes the URL of the current document from the document history, meaning that it is not possible to use the "back" button to navigate back to the original document.
But what's the difference between these two and changing the location by
window.location = "www.example.com" ?
What about
<a href> ?
And
history.pushState?
EDIT
Some of you marked this as duplicated because of Javascript: Setting location.href versus location and What's the difference between window.location= and window.location.replace()? but it is not. My question's far wider than this.
It's everywhere "how to change location" but I didn't find a full comparison between these methods.