title: Line endings (also known as Newlines) in JS strings
body: <p>It is well known, that Unix-like system uses <code>LF</code> characters for newlines, whereas Windows uses <code>CR+LF</code>. </p>
  
  <p>However, when I test this code from local HTML file on my Windows PC, it seems that JS treat all newlines as separated with <code>LF</code>. Is it correct assumption?</p>
  
  <pre><code>var string = `
      foo
  
  
  
  
      bar
  `;
  
  // There should be only one blank line between foo and bar.
  
  // \n - Works
  // string = string.replace(/^(\s*\n){2,}/gm, '\n');
  
  // \r\n - Doesn't work
  string = string.replace(/^(\s*\r\n){2,}/gm, '\r\n');
  
  alert(string);
  
  // That is, it seems that JS treat all newlines as separated with 
  // `LF` instead of `CR+LF`?
  </code></pre>