
In general, you can scroll to a point whose coordinates indicates the distance from it to the top and left side of document. So, the following code scrolls to top of the page:
// window.scrollTo(pageX, pageY);
window.scrollTo(0, 0);
Utilizing this snippet, you can add a button at the bottom of page that allows user to scroll to the top quickly.