title: How to remove forward and backward slashes from string in javascript
body: <p>I want to remove all the forward and backward slash characters from the string using the Javascript. </p>
  
  <p>Here is what I have tried:</p>
  
  <pre><code>var str = "//hcandna\\"
  str.replace(/\\/g,'');
  </code></pre>
  
  <p>I also tried using <code>str.replace(/\\///g,'')</code>, but I am not able to do it.</p>
  
  <p>How can I do it?</p>