There are two ways by which you can achieve that
If you want to simulate someone clicking on a link, use location.href
// similar behavior as an HTTP redirect
If you want to do an HTTP redirect, use location.replace.
// similar behavior as clicking on a link
window.location.href = "http://www.google.com";