Skip to main content
InterviewHubPRO
Section Overview
Q82

Question 82 of 536

Part 2: Promises, Callbacks, Async & Strict Mode (54 - 103)

15%
JavaScript & V8 Internals (536 Qs)•Part 2: Promises, Callbacks, Async & Strict Mode (54 - 103)

How do you access history in javascript

mid LevelMost AskedCode ExampleAsync & Promises

The window.history object contains the browser's history. You can load previous and next URLs in the history using back() and next() methods.

javascript
function goBack() {
  window.history.back();
}
function goForward() {
  window.history.forward();
}

Note: You can also access history without window prefix.