Use console.log to provide diagnostic capabilities for debugging.
console.log("Hello, world!") ; //will print Hello, World! in the console
Other parameters can be passed in, such as document.cookies to show what cookies are currently used by the document, or passing a variable that has been assigned getElementsById:
var = myVar.getElementsBtId("p") ;
This will return an array of all the p elements, that can further be drilled down into within the console.
document.body.style.color = "blue"