title: How can I replace all occurrences of a dollar ($) with an underscore (_) in javascript?
body: <p>As the title states, I need to relace all occurrences of the $ sign in a string variable with an underscore.</p>
  
  <p>I have tried:</p>
  
  <pre><code>str.replace(new RegExp('$', 'g'), '_');
  </code></pre>
  
  <p>But this doesn't work for me and nothing gets replaced.</p>