title: Delete a specific repeated character in javascript
body: <p>I've seen the following question <a href="https://stackoverflow.com/questions/5111967/regex-to-remove-a-specific-repeated-character">Regex to remove a specific repeated character</a> which is extremely similar to mine (if not exact) but it's implemented in C# and using that language's string methods.</p>
  
  <p>I am wondering if someone could come up with a <code>javascript</code> implementation of it?</p>
  
  <p>Example if you have </p>
  
  <pre><code>what---is-your-name- =&gt; what-is-your-name
  
  ---what-is----your-name-- =&gt; what-is-your-name
  </code></pre>
  
  <p>So how to remove the recurrence of a specific character, in this case <code>-</code> and replace it with just one <code>-</code> in javascript?</p>