How to change the URL address using javascript

Posted on December 14, 2021

Here the snippet:

location.href = 'https://www.example.com'

And to reload the current address:

location.reload()