+ 2

What is difference between document.write and console.log?

23rd Jul 2016, 1:17 AM
Faithmotion Music
Faithmotion Music - avatar
4 Réponses
+ 8
Console log sends a answer to the console, try open google chrome and press f11 "i guess" chrome will show u the console. When u put your information at the console.log it will show right there. On the other hand when u put any info at the doc.write it will show u when your doc gets executed
23rd Jul 2016, 5:11 AM
Elias Simoes
Elias Simoes - avatar
+ 2
if you want print any content in DOM use document.write, console.log also print the values while debugging the script in developer tool
26th Jul 2016, 3:40 PM
Prabhakar Karajani
Prabhakar Karajani - avatar
0
"console.log" will put your information in the console. You can access the log if you click "inspect" when you double click on mac (not sure if its right or left click on windows desktops lol) thats really only for developer eyes (back end) not the general user. But if you use "document.write" it will just add html to the page making it visible on the webpage (front end)
15th Aug 2016, 2:29 AM
Andrea Como
Andrea Como - avatar
0
with document.write your answer can you see in the browser, and with console.log your answer you can see only in the console :)
25th Aug 2016, 5:15 AM
danna delzo meza