var docTitle = document.title;
As you can see document.title is the key in the above code. Below then we will go a step further, and actually load the title into a span tag inside the HTML document:
var spanTitle = document.getElementById("title");
spanTitle.innerHTML = document.title;
<b>Page Title: </b>
Piece of cake!