0
What is difference between console.log(" "), window.alert(" ") and document.write(" ") in JavaScript??
When I write document.write() in ide like vs code or Jetbrains webstorm I got an error and while I write console.log() in html in <script> tag I got an error.
1 Answer
+ 1
console.log adds an log message, alert creates a alert box and document.write allows you to write html into the html document...
I can't tell you why you get errors, but here on Sololearn all three functions work perfecly