window.location.href = 'https://blog.fraserhamilton.dev/'
This will redirect the user and create a new entry in your browsers history stack, meaning you can go back to the previous page using the back button. If you wish to instead simulate a http redirect we can use replace:
We can also use the window.history methods to navigate across the browsers history stack:
window.history.forward() window.history.back() window.history.go(1) window.history.go(-2)