title: Cannot insert newline in JavaScript
body: <p>How do I insert a newline character in JavaScript? The below code displays everything in one line even when using the newline character in for loop</p>
  <pre><code>function isEven(number)
  {
      if (number % 2 == 0)
          return 1;
      else
          return 0;
  }
  
  for (let i=0;i&lt;=30;i++)
  {
      if (isEven(i) == 1)
      {
          document.write(i + &quot; even\n&quot;);
  
      }
      else {
          document.write(i + &quot; odd\n&quot;);
  
      }
  
  }
  </code></pre>