title: How to compare strings in google apps script
body: <p>I am trying to compare string values that I have obtained from my google spreadsheet.</p>
  
  <p>My Months appear in this format " Jun13", "Aug13" etc. and my script has trouble comparing the values when they are in such formats</p>
  
  <pre><code>var data = ss.getRange(2,2,ss.getLastRow(),3).getValues();
  var ListOfMonths = new Array();
  
  for(var i = 0; i &lt; data.length; ++i){
  
  var row = data[i][0];
  var duplicate = false;
    for(j in ListOfMonths){
        if(row.toString.match(ListOfMonths[j][0])){
          duplicate = true;
        }
        if(!duplicate){
          ListOfMonths.push(row);
        }
    }
  }
  </code></pre>
  
  <p>Could someone help me with this issue of comparing strings? I also tried == and === but they all don't work</p>