Exam4Training

If the back button is clicked after this method is executed, what can a developer expect?

A developer implements and calls the following code when an application state change occurs:

Const onStateChange =innerPageState) => {

window.history.pushState(newPageState, ‘ ’, null);

}

If the back button is clicked after this method is executed, what can a developer expect?
A . A navigate event is fired with a state property that details the previous application state.
B . The page is navigated away from and the previous page in the browser’s history is loaded.
C . The page reloads and all Javascript is reinitialized.
D . A popstate event is fired with a state property that details the application’s last state.

Answer: B

Exit mobile version