what is the difference between console.log and document.write?
The main difference is that document. write() inserts text into the document (the webpage in the browser window); console. ... log() is a method of the JavaScript Console, a special object incuded in browsers for developers to use to debug and test their code in an interactive terminal.