toString() in JavaScript

function writeText(){
         document.write("Some dummy text");
    }
    var func = writeText.toString();

    document.write("The string representation of the writeText");
    document.write(" function looks like: " + "<br><br><b>");
    document.write(func + "</b>");