// go back:
window.history.back()
// go forward:
window.history.forward()
// go to specific point:
window.history.go(-2) // go back 2 pages, 0 is current page
window.history.go(0) // refreshes current page
window.history.go() // refreshes current page
// get number of pages in history
let numberOfEntries = window.history.length
// Should be null because we haven't modified the history stack yet
console.log(`History.state before pushState: ${history.state}`);
// Now push something on the stack
history.pushState({name: 'Example'}, "pushState example", 'page3.html');
// Now state has a value.
console.log('History.state after pushState: ', history.state);