title: function always returning false
body: <p>Fairly new to Javascript, could anybody tell me why this simple array loop / string comparison function always returns false? They're both of type string and the data is the same, the loop should absolutely return true. Possible syntax error? Also is there an easier way of running this check.</p>
  
  <pre><code>function imageDuplicate(fileName)
  {
      $.each(previewImagesArray, function(index)
      {
          if(previewImagesArray[index].name == fileName)
              return true;
      });
      return false
  }
  </code></pre>
  
  <p>Thanks in advance.</p>