redirect to url in javascript

JavaScript
window.location.href = "http://mywebsite.com/home.html";$(location).attr('href', 'https://google.com');window.location = "https://example.com/";
Source

Also in JavaScript: