javascript history code example

Example 1: who created javascript

Brendan Eich

Example 2: founder of javascript

Brenden Eich is the founder of JavaScript and the amazing thing 
about him is He have developed JavaScript in just 10 Days

Example 3: js window history

// 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

Example 4: js go to see history

history.go([delta])
delta Optional
The position in the history to which you want to move, relative to the current page. A negative value moves backwards, a positive value moves forwards

Example 5: js history

// 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