title: remove special chars in array of strings in javascript
body: <p>I wanted to loop over an array of string in js and mutate the element which is having special character by removing I am able to do it with string  but not with an array of string</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>var names = ['created_at', 'placed-at', 'room-no'];
  console.log(names)
  names.forEach((element) =&gt; {
   element = element.replace(/[^a-zA-Z ]/, ' ');
  });
  console.log(names)
  //however this regex work fine with independent strings like below 
  var name= "created_at"
  name = name.replace(/[^a-zA-Z ]/, ' ');
  console.log(name)</code></pre>
  </div>
  </div>
  </p>