window.history object stores an array of URLs visited by the user. All the url's can whenever loaded gets stored in the object which can be used later to navigate.
window.history object can be written also without the
window prefix like all window objects.
|Works as clicking back button in the browser.
|Works as clicking forward button in the browser.
history.back() method loads the previous URL in the history list. It allows the user to load whatever the previous loaded page was in the same tab.
history.forward() method loads the next URL in the history list. It allows the user to go to the page from which the user came back by clicking backward button.