title: JavaScript replace all comma in a string
body: <p>I want to convert all comma in below string to space or say blank, i tried below code which is only taking care of first comma, I tried global indicator /g as well but that do nothing.</p>
  
  <p>What I am doing wrong?</p>
  
  <pre><code>var str="D'Or, Megan#LastName Jr., FirstName#BMW, somename#What, new";
  str=str.replace(',','');
  alert(str)
  </code></pre>
  
  <h3>Output</h3>
  
  <blockquote>
    <p>D'Or Megan#LastName Jr., FirstName#BMW, somename#What, new</p>
  </blockquote>
  
  <h3>expected</h3>
  
  <blockquote>
    <p>D'Or Megan#LastName Jr. FirstName#BMW somename#What new</p>
  </blockquote>