title: indexOf not working in Google Apps Script
body: <p>I'm making a Google Sheets doc which analyzes my bank transaction history. A number of my transaction descriptions begin with the same letters, specifically "SIG" (correct casing). I want to count the number of these transactions, but I can't.</p>
  
  <p>For troubleshooting, I've ensured that indexOf works when I'm only checking one cell/input. It returns "-1" when it can't find "SIG" in the cell and "0" when it does find "SIG" at the beginning of the cell.</p>
  
  <p>Again troubleshooting, I've also ensured that I'm correctly looping through an array (multiple cells) which just counts the number of non-null cells. That also works.</p>
  
  <p>When I try to put everything together tho, I can't get it to work, and I don't know why. The short function is below. Thanks for the help.</p>
  
  <pre><code>function SIG_counter (descriptions) {
    var SIG_total = 0;
    var SIG_checker;
    for (var i=0; i&lt;descriptions.length; i++) {
      var SIG_checker = descriptions[i].indexOf("SIG");
      Logger.log(descriptions[i]);
      Logger.log(SIG_checker);
      if (SIG_checker == 0.0) {
        SIG_total++;
      }
    }
    return SIG_total;
  }
  
  var sample_array = ["Funds Added (Donation)",
                      "SIG POS purchase at Paypal",
                      "PIN POS purchase cashback",
                      "PIN POS purchase cashback",
                      "SIG POS purchase at Paypal"]
  
  function trouble_shooter () {
    SIG_counter(sample_array);
  }
  </code></pre>
  
  <p>Log:</p>
  
  <pre><code>[18-01-28 15:30:54:630 PST] Funds Added (Donation)
  [18-01-28 15:30:54:630 PST] -1.0
  [18-01-28 15:30:54:631 PST] SIG POS purchase at Paypal
  [18-01-28 15:30:54:631 PST] 0.0
  [18-01-28 15:30:54:632 PST] PIN POS purchase cashback
  [18-01-28 15:30:54:632 PST] -1.0
  [18-01-28 15:30:54:632 PST] PIN POS purchase cashback
  [18-01-28 15:30:54:633 PST] -1.0
  [18-01-28 15:30:54:633 PST] SIG POS purchase at Paypal
  [18-01-28 15:30:54:634 PST] 0.0
  </code></pre>