title: Find json element within object and remove it
body: <p>Using jquery, how would I go about finding the index of a JSON object.</p>
  
  <p>Below is what is created:</p>
  
  <pre>[{"itemid":3,"itemName":"Some text here","itemPrice":"£2.40"},{"itemid":3,"itemName":"Some text here","itemPrice":"£2.40"},{"itemid":2,"itemName":"Some text here","itemPrice":"£2.40"}]</pre>
  
  <p>Here is how it translates in console:</p>
  
  <pre>
  [Object, Object, Object]
  0: Object
  itemName: "Some text here"
  itemPrice: "£2.40"
  itemid: 3
  __proto__: Object
  1: Object
  itemName: "Some text here"
  itemPrice: "£2.40"
  itemid: 3
  __proto__: Object
  2: Object
  itemName: "Some text here"
  itemPrice: "£2.40"
  itemid: 2
  __proto__: Object
  length: 3
  __proto__: Array[0]
  </pre>
  
  <p>If i wanted to look through the string by searching for the itemid as the value to find, and then go back and remove it from the string using splice, what would the code look like.  I keep getting odd errors.   </p>
  
  <p>Here is the code i have:</p>
  
  <p>This creates the json string:
      var item = {"itemid" : itemId, "itemName" : itemName, "itemPrice" : itemPrice};</p>
  
  <pre><code>cOrder.push(item);
  localStorage.setItem('cOrder', JSON.stringify(cOrder));
  </code></pre>
  
  <p>Here i search through the string to get the the right element to remove:</p>
  
  <pre><code>var itemid = ($(this).text());
  console.log(cOrder);
  $.each(cOrder, function(key, value) {
      if(value.itemid == itemid) {
      // Here i need to get the index of the object //
      console.log(Object.keys(cOrder).indexOf(this));
      }
  });
  </code></pre>
  
  <p>Using the above as a working example.  If i wanted to remove itemid 3, I need to remove object index 1 (1 : Object)</p>
  
  <p>How do I get that index 1, and then remove it from the string ?</p>
  
  <p>Thanks in advance</p>