Can i asking something . what difference code * document.write(""); than console.log(""); . ??? Please answer | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can i asking something . what difference code * document.write(""); than console.log(""); . ??? Please answer

Please answer

12th Oct 2021, 11:44 PM
Baits Rika Saputra
3 Answers
+ 5
It's in the name(s). One writes to a document, the other outputs to the console.
12th Oct 2021, 11:50 PM
Simon Sauter
Simon Sauter - avatar
0
document.write will write your JS output and exclude all the HTML elements from the DOM tree. So all you'll see is your document.write output while console.log writes the output separately on a console window.
13th Oct 2021, 3:03 AM
zexu knub
zexu knub - avatar
0
document.write replace all document text with the new one. Cobsole.log write things in new console.
13th Oct 2021, 3:22 AM
Divya Mohan
Divya Mohan - avatar