The PopStateEvent() constructor creates a new PopStateEvent object.
Note: A web developer doesn't typically need to call this constructor, as the browser creates these objects itself when firing popstate events.
new PopStateEvent(type, options)typeA string with the name of the event. It is case-sensitive and browsers set it to popstate.
options OptionalAn object that, in addition to the properties defined in Event(), has the following property:
state OptionalAn object representing the state. Practically it is a value provided by the call to history.pushState() or history.replaceState(). If not set, it defaults to null.
A new PopStateEvent object.