What is the purpose of push() and replace() methods of history?

Posted by Prem Tiwari | Updated on

What is the purpose of push() and replace() methods of history?

A history instance has two methods for navigation purpose.

  1. push()
  2. replace()

If you think of the history as an array of visited locations, push() will add a new location to the array and replace() will replace the current location in the array with the new one.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers