I get a little confusion between console.log and document.write | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I get a little confusion between console.log and document.write

I know that they are all used for printing out something,but is there any difference When and where to use console.log and document.write as well

19th Feb 2017, 5:49 AM
Thành Long
Thành Long - avatar
2 Answers
+ 8
document.write will be displayed directly on the html page and mostly is not used for actually writing on the page console.log will display on inspector tab (click F12 on most web browsers) of the browser (on the sololearn playground it will be shown in the bottom of the screen) and it is mainly useful for debugging (displayinh messages and what not)
19th Feb 2017, 6:33 AM
Burey
Burey - avatar
+ 1
Oh i finally take it , thanks you so much :*
19th Feb 2017, 7:30 AM
Thành Long
Thành Long - avatar