A simple one, to come back from a long blogging break…
To navigate to a different site in the same browser tab:
document.location.href = targetUrl
To open a URL in a new browser tab:
If you are working on a single page app, you should probably go to a router route instead. Consult your library or framework!
P.s. I am now on bluesky where my handle is this domain name 😎