To open window.location in new tab with JavaScript, we call the window.open method.
For instance, we write
window.open("https://example.com", "_blank");
to call window.open with the URL to open and '_blank' to open the URL in a new window or tab.