3rd Edition By Robin Nixon (O'Reilly 2014, ISBN 978-1491949467)
About | Buy Paperback / Kindle | 3rd Edition Examples | Errata | Editions: 1st 2nd 3rd 4th
What's more, document.write() is a single, short function call that is self-evident as to what it does, and is therefore perfect for quickly displaying a result. It keeps all the examples short and sweet, and places the output right there in the browser. As many programmers agree, document.write() is useful for testing short code snippets, and for for displaying quick results. And, following correct practice, none of the examples in this book that continue to run after a page has fully loaded, use the document.write() function - other, better methods are always taught and employed.
In summary, document.write() is only ever used in this book as a convenience (instead of calling the console.log() function) to show values or the results of expressions. It is never used to (or intended to teach how to) display web browser content.
I hope that clears things up, and thanks for asking :)