+ 1
What's the difference between console.log and document.write
I don't understand them
3 Réponses
+ 15
Console.log outputs to the javascript console.
document.write writes to the current html document erasing previous elements.
https://developer.mozilla.org/en/docs/Web/API/Console/log
Console.log() - Web APIs | MDN
https://www.w3schools.com/js/js_output.asp
JavaScript Output - W3Schools
https://www.w3schools.com/jsref/met_doc_write.asp
document.write() - W3Schools
https://developer.mozilla.org/en-US/docs/Web/API/Document/write
Document.write() - Web APIs | MDN
+ 2
Thanks
+ 1
console.log brings in the browser console, and document.write to the page