It is similar to clicking on a link. As a side note.. you can use either of the following two, both are same in terms of behavior.
window.location = "http://newUrl.org";
window.location.href = "http://newUrl.org";
The href property sets or returns the entire URL of the current page. The window.location returns a Location object. If the href parameter is not set, window.location defaults to change the value of href.
Which one is better:
window.location.replace(url)
OR
window.location.href = url; -- Nicholas Lake, Sep 06, 2016
Prefer using location.replace to location.href. The location.replace simulates an HTTP redirect while location.href simulates someone clicking on a link.
The location.replace() navigates to the new URL without keeping the original page in the history, and therefore the browser's Back button won't fail/stop working in this case. -- Allen Turner-Eloy, Sep 06, 2016
We know that the search engines don't analyse the JavaScript code and therefore cannot see the redirection by default. However, if you want to notify them about the redirection, add the rel="canonical" meta tag to your website.
Also, you can add a noscript section with a HTML refresh meta tag in it.