This output stream is basically the page that users see!
This means if there’s already a document displayed to users, then calling this method on top of the document will remove the old content and display the new content instead.
For example, using this method we can send a message like “Hello World” to the page.
Or put HTML elements as the argument of this method and they will be rendered on the page.
Note: this method works the same as the write() method with the exception that the writeln() method adds a newline character per each call to the method.
For example, if you call the writeln() method three times, then you’ll get three new lines as a result of calling this method.
document writeln() Method Syntax:
document writeln() Method Parameters
The function takes one or more arguments and it will combine and send them to the output stream.
document writeln() Method Return Value
The method does not return a value.