window.location.href = 'https://www.google.com'
NOTE: You can use window.location = 'https://www.google.com'
or window.location.assign('https://www.google.com')
as well.
location = 'http://www.example.com'
is a synonym oflocation.href
= 'http://www.example.com'. - Source
window.location.replace('https://www.google.com')
will clear the back history.