as of my previous question what is the difference between document.write() and console.log() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

as of my previous question what is the difference between document.write() and console.log()

28th Jan 2018, 9:58 AM
Ankan Sharma
Ankan Sharma - avatar
4 Answers
+ 11
document.write method output to the DOM while console.log output to the browser console, which is hidden to the user by default. You can learn more by searching at MDN site. 😉
28th Jan 2018, 10:02 AM
Zephyr Koo
Zephyr Koo - avatar
+ 5
good luck altering Facebook's source code
28th Jan 2018, 10:12 AM
wout werkman
wout werkman - avatar
+ 4
document.write( ) is a function that litturally puts text inside of your body, this should only really be used when you don't have a page, as you can't really control what document.write does. console.log( ) is a cleaner method which will log only in the console, on normal browsers this is only shown when developer tools is opened
28th Jan 2018, 10:07 AM
wout werkman
wout werkman - avatar
0
the passwords like fb, gmail are shown i dots to user. if we can alter the page source code of printing password from console.log() to document.write() then can we see the password i.e by user
28th Jan 2018, 10:11 AM
Ankan Sharma
Ankan Sharma - avatar