title: jQuery Grep on JSON object using selected list item index
body: <p>I have an unordered list containining list items created from a JSON object. Each item in the JSON object has a property for index. </p>
  
  <p>jQuery click event bound to UL:</p>
  
  <pre><code>$j("#courseGallery li").bind('click', function () {
     var index = $j("#courseGallery li").index(this);
     GetSelectedCourseInfo(index);
  });
  </code></pre>
  
  <p>jQuery function to filter JSON data based on selected list item index in UL:</p>
  
  <pre><code>GetSelectedCourseInfo = function (index) {
      filteredData = $j.grep(sortedCourseData, function (e) {
          return e[index] === index;
      });
      if ($j("#altriaCourseDetails").children().length &gt; 0) {
          $j(this).children().remove(); 
      }
      $j("#altriaCourseDetails").html($j("#selectedCourseTemplate").render(filteredData));
  };
  </code></pre>
  
  <p>JSON data sample:</p>
  
  <pre><code>[
  {
      "index":0,
      "title":"Foo1",
      "description":"Bar1",
  },
  {
      "index":1,
      "title":"Foo2",
      "description":"Bar2",
  },
  {
      "index":2,
      "title":"Foo3",
      "description":"Bar3",
  }
  ]
  </code></pre>
  
  <p>Unfortunately, the item in the array is not being found based off the index. Any help would be appreciated.</p>
  
  <p>Thanks.
  &nbsp;</p>