The code pushes two history entries with state, then calls history.back(). What does it log, and in what order?
window.addEventListener("popstate", (event) => {
console.log("popstate " + event.state.page);
});
history.replaceState({ page: "home" }, "");
history.pushState({ page: "list" }, "");
history.pushState({ page: "item" }, "");
console.log("pushed " + history.state.page);
history.back();
console.log("after back() " + history.state.page);