0

I am having below code, this code opens new tab instead i want to replace existing page/tab. I do not know what are parameters i need to add in the below code

let newTab = window.open();
newTab.location.href = 'http://www.google.com';

the problem this opens the page in new window, instead it should replace the existing page. i am not supposed use it below code, instead i want to have same action in the above code

window.open('http://www.google.com', '_self')

Any help?

Sakthivel
  • 678
  • 2
  • 6
  • 19
  • 1
    If the duplicate of your question has over 16,000 upvotes, then you should take it as an indication that you need to improve your research skills. – Rory McCrossan Feb 01 '23 at 14:39

0 Answers0