window. location.href
This window.location.href is basically helps to get or set the URL you are currently working on. If you click on some URL or link it will navigate to that particular URL.
Example:
// Redirect the current page to a new URL
window.location.href = 'https://www.example.com';
window.open()
This is used to open a new window or the tab with a specified URL.
And also we can add additional parameters such as its size, toolbar
And scrollbars.
Example:
// Open a new window with a specified URL and features
window.open('https://www.example.com', '_blank', 'width=800,height=600');