+ 1
what is difference between console.log and document.write?
3 Answers
+ 8
Developers use console.log() for logging useful info.
document.write modifies what user sees in the browser by adding additional content to DOM.
+ 2
console.log method is used to print text to the console, and document.write essentially adds text to the page. for example, go onto a browser, open up inspect element, go into the console tab and at the prompt write console.log(âhiâ); and then write document.write(âhiâ); . as you can see console.log writes it to the console, whereas document.write writes it to the page. console.log is good for logging server statuses and loads.
- 4
Nothing