title: "replace is not a function"
body: <p>I'm trying to remove the comma from a number.</p>
  
  <pre><code>var thisbill_str = ""; 
  thisbill = $('#linebill_' + z).val(); 
  if (isNaN(thisbill) ) { thisbill = 0.00; } 
  thisbill_str = thisbill; 
  thisbill = thisbill_str.replace(/,/g, ""); 
  </code></pre>
  
  <p>This javascript code is giving me an error:</p>
  
  <pre><code>TypeError: thisbill_str.replace is not a function
  </code></pre>
  
  <p>It doesn't matter if I give it the 'g' and 'i' flags.
  It only does it if the string does NOT already have a comma in it, i.e., if the string is '515.00'. If the string were '5,515.00', then it works fine.
  I don't see anything in the documentation that tells me that the string to be replaced has to actually exist. What am I missing, and what is a better way to do this?</p>