title: Remove consecutive duplicate characters using regex
body: <p>Well i have following type of input and desired output.What i basically want to do is remove consecutively repeating characters.(Keep first character removed all the following consecutively repeating).  </p>
  
  <pre><code>input = dup(["abracadabra","allottee","assessee"])
  output = ["abracadabra","alote","asese"].
  
  input = dup(["kelless","keenness"])
  output =  ["keles","kenes"]
  </code></pre>
  
  <p>This is what i have done till now.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let arr1 = ["abracadabra", "allottee", "assessee"];
  let arr2 = ["kelless", "keenness"];
  
  function dup(input) {
    return input.map(e =&gt; {
      let tempOp = ''
      for (let i = 0; i &lt; e.length; i++) {
        if (i === 0) tempOp += e[i];
        else if (e[i - 1] !== e[i]) tempOp += e[i]
      }
      return tempOp;
    })
  }
  console.log(dup(arr1))
  console.log(dup(arr2))</code></pre>
  </div>
  </div>
  </p>
  
  <p>I can do it with for loop. But is there any other better way of doing it.
  Can i do it with regex if yes any direction will help a lot.</p>