Is "document.write" the same thing as (console.log)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Is "document.write" the same thing as (console.log)?

It took a JS course on codecademy.com and they used console.log to print out. Here they use document.write. Do they serve the same purpose??? Thanks! ;-)

9th Jul 2016, 2:53 PM
Hannah T
Hannah T - avatar
2 Answers
+ 7
No console.log() prints the data in the browser's console. and document.write() prints on the browser's window . go to developer tools by pressing fn + f12 (windows pc)and there you can see the console.
9th Jul 2016, 4:47 PM
Sumanth Reddy
Sumanth Reddy - avatar
+ 2
Thanks! That makes so much sense!
9th Jul 2016, 5:51 PM
Hannah T
Hannah T - avatar