title: removing exclamation mark from a string javascript
body: <p>Hi I know this code works but I dont understand it, could someone please explain.</p>
  
  <pre><code>function remove(s){
  return s.replace(/!+$/, '');
  }
  remove('Hi!'); // outputs 'Hi'
  remove('!Hi'); // outputs 'Hi'
  </code></pre>
  
  <p>I understand the ! is replaced with the empty string but what are the back slashes, plus and dollar signs???
  thanks </p>