1.

Which of the following method is used to replace the current history state instead of adding a new state to the browsing history?(a) replaceState()(b) replace(state)(c) replace()(d) change()The question was posed to me in unit test.My doubt stems from History Management in JavaScript topic in chapter Sockets of JavaScript

Answer» RIGHT CHOICE is (a) replaceState()

The best explanation: The replaceState() method is USED to replace the current history state INSTEAD of adding a NEW state to the browsing history. It updates the most recent entry on the history stack to have the specified data, title, and, if provided, URL.


Discussion

No Comment Found

Related InterviewSolutions