title: How to check if value exists in array using javascript
body: <p>I have an an array in the form:</p>
  
  <pre><code>"localValues" : [
      {
          "localValId" : "8KfbEozjdQYAefuHF",
          "localProductCode" : "291105300",
          "localMarkupVal" : "2.8",
          "localMembersPrice" : "3344"
      },
      {
          "localValId" : "qdCY6Kkvc7e8m4yxw",
          "localProductCode" : "291105300234",
          "localMarkupVal" : "2.8432",
          "localMembersPrice" : "3344333"
      },
      {
          "localValId" : "i827Eve8zBexRSTSP",
          "localProductCode" : "291105300",
          "localMarkupVal" : "2.8432",
          "localMembersPrice" : "899"
      }
  </code></pre>
  
  <p>I am trying to return the location of a localProductCode:</p>
  
  <pre><code>var a = localValues;
  
  var location = a.indexOf('291105300');
  
  console.log('location: ' + location)
  </code></pre>
  
  <p>However, this returns -2, which is incorrect since that code does exist in teh array. Can someone help? Thank you in advance!</p>