1. When a state object is replaced
  2. When a state object is added
  3. When a state object is removed
  4. None of the mentioned
4 views

1 Answers

Answer: Option 3

The window.onpopstate event is fired whenever a state object is removed from the browser history, which occurs on browser “back” or “forward”. State objects are persisted on the user’s hard disk between sessions, which is a nice feature. The object passed into a call to pushState or replaceState is provided as the state property on the event object in the “popstate” event.

4 views