The NavigationCurrentEntryChangeEvent() constructor creates a new NavigationCurrentEntryChangeEvent object.
new NavigationCurrentEntryChangeEvent(type, init)typeA string representing the type of event.
initAn object that, in addition to the properties defined in Event(), has the following properties:
fromA NavigationHistoryEntry object representing the location being navigated to.
The type of the navigation that resulted in the change. Possible values are push, reload, replace, and traverse. Defaults to null.
A new NavigationCurrentEntryChangeEvent object.
A developer would not use this constructor manually. A new NavigationCurrentEntryChangeEvent object is constructed when a handler is invoked as a result of the currententrychange event firing.
navigation.addEventListener("currententrychange", (event) => {
console.log(event.navigationType);
});