How to redirect to another page in JavaScript

URL
Last updated Dec 16, 2017
window.location.href = "https://codetogo.io";