+ 1

wouldn't it be better if i used console.log instead of document.write

what is the difference

20th Aug 2016, 7:32 PM
Ineza Bonté
Ineza Bonté - avatar
2 Réponses
+ 1
console.log is better for debugging and testing your code, and he document.write is for writing on the document. in my opinion i don't like document.write and im also using console.log and alert to see if my code works or not
21st Aug 2016, 12:35 AM
Fernando Carlo
Fernando Carlo - avatar
0
console.log writes to the console, it won't actually write anything on your page, so it's only used for debugging.
21st Aug 2016, 6:56 AM
Shahin
Shahin - avatar