The correct answer is C .
The browser provides the History API through:
window.history
To add a new entry to the browser’s session history without refreshing the page, JavaScript uses:
window.history.pushState(state, title, url);
So the valid statement is:
window.history.pushState(newStateObject, ' ' , null);
This updates the browser history stack without forcing a full page reload. It is commonly used in single-page applications when changing views or routes dynamically.
The method accepts three arguments:
window.history.pushState(stateObject, title, url);
stateObject stores custom data associated with the history entry.
title is usually passed as an empty string because many browsers ignore it.
url optionally changes the displayed URL. Passing null means no new URL is provided.
Option A is incorrect because:
window.customHistory
is not the standard browser History API object.
Option B is incorrect because:
createState()
is not a valid History API method.
Option D is incorrect because:
updateState()
is not a valid History API method.
The correct browser API method is:
window.history.pushState()
Therefore, the verified answer is C .