title: How to replace all characters in a string except first and last characters, using JavaScript
body: <p>I need to write a solution in JavaScript to replace all the characters in a string with a *, except for the first and last characters. I'm not very familiar with RegEx but was trying to use the following to achieve the solution:</p>
  
  <pre><code>var regex = /\.(?=^)(?!=$)/;
      const censored = w.replace(regex)
      console.log(censored)
  </code></pre>
  
  <p>Any ideas on how I can achieve this?</p>