<!DOCTYPE html>
<html lang="en-US">
<body>
<p>document.write does not add '\n' (new line) at the end of each statement.</p>
<pre>
<script>
document.write("Hello");
document.write("world");
</script>
</pre>
<p>document.writeln add '\n' (new line) at the end of each statement.</p>
<pre>
<script>
document.writeln("Hello");
document.writeln("world");
</script>
</pre>
<p><strong>Note</strong>: This difference works only inside pre tag. Try to remove all pre tags and click 'Run' button.</p> </body>
</html>