title: How can you do a non-case sensitive search of an array?
body: <p>I have a function that returned a list of unique names in a spreadsheet column.  I was looking for a way that I could make the check not case sensitive without forcing everything lowercase.   Here is my original code:</p>
  
  <pre><code>function testGetUniqueClassNames(){
     var sheet =  getRosterSheet();
     var dataRange = sheet.getDataRange();
     var indices = returnIndices();
     dataRange = dataRange.getValues();
     var classNames = getUniqueClassNames(dataRange, indices.clsNameIndex, indices.crfIdIndex);
  
     Logger.log(classNames);
  }
  
  
  function getUniqueClassNames(dataRange, clsNameIndex, crfIdIndex) {
    var classNames = [];
    for (var i=2; i&lt;dataRange.length; i++) {
      var thisClassName = dataRange[i][clsNameIndex];
      var thisClassRoot = dataRange[i][crfIdIndex]; 
  
   if ((classNames.indexOf(thisClassName)==-1)&amp;&amp;(thisClassName!='')&amp;&amp;(thisClassRoot!='')) {
        classNames.push(thisClassName);
      }
  
    }
    classNames.sort();
    return classNames;
  
  }
  </code></pre>