How to write a script for scrolling the page?

Needed a script that will scroll the page all the way up, then immediately to the bottom.

Why is not working?

function scrl()
 scrollTo(0, 0);
 scrollTo(0, document.body.scrollHeight);

Not true calculates the height?
July 8th 19 at 16:08
0 answer

Find more questions by tags JavaScriptParsing