window.location.replace(...) is better than using window.location.href, because replace() does not keep the originating page in the session history, meaning the user will not have a chance in never-ending back-button fiasco.

In a nutshell:

To simulate someone clicking on a link, use window.location.href.

// similar behavior as clicking on a link
window.location.href = "";

To simulate an HTTP redirect, use window.location.replace.

// similar behavior as an HTTP redirect

MDN Web Docs – Window.location

Last modified: January 13, 2018