JavaScript Window location.assign()
JavaScript Window location.assign()
The assign() method is used for loading a new document. It is similar to replace() method but the main difference is that replace() method removes the current URL from the history list and we can not go back or navigate backward.
Syntax:-
Its syntax is:- location.assign(URL)
Further Explanation:-
Parameter | Description |
URL | Required. The URL of a page to navigate to. |