title: Javascript regexp backslash removal query
body: <p>I was looking at the responses to the question at <a href="https://stackoverflow.com/questions/4870769/removing-backslashes-from-strings-in-javascript#">Removing backslashes from strings in javascript</a>
  and found that both the responses work,</p>
  
  <pre><code>string.replace(/\\\//g, "/");
  </code></pre>
  
  <p>and</p>
  
  <pre><code>str = str.replace(/\\/g, '');
  </code></pre>
  
  <p>Could someone please explain the difference between these two and which would be a better choice?</p>