0
I'm learning JavaScript from codcadmey and on there course if i have to print something on the console I've to write console.log
and on other places have to write document.write why this difference please explain
2 odpowiedzi
+ 3
It depends on you how to print the output.
document.write - prints the output to the page.
console.log - prints the output to the JS console.
+ 2
document.write prints the text on the html file that is linked to the js.
console.log prints the text on the javascript console.