title: Javascript - How to show escape characters in a string?
body: <p>Very simple question, but for some reason I can't find the answer anywhere after 10 minutes of Googling. How can I show escape characters when printing in Javascript?</p>
  
  <p>Example:</p>
  
  <pre><code>str = "Hello\nWorld";
  console.log(str);
  </code></pre>
  
  <p>Gives:</p>
  
  <pre><code>Hello
  World
  </code></pre>
  
  <p>When I want it to give:</p>
  
  <pre><code>Hello\nWorld
  </code></pre>