title: Getting a concrete element from an observableArray
body: <p>This seems easy but after two hours my head hurts.</p>
  
  <p>I have a categoryIndex (from a select) and I want to get the category from an observableArray who have that Id.</p>
  
  <p>How I do that? I tried with indexOf (but Im not sure how it works and I looked the doc of course), I tried linq.js but the Where is hard to use or Im stupid (I don't know how to get the Id from a category and compare it).</p>
  
  <p>My observableArray is this:</p>
  
  <pre><code>categories[category { Id=2,  Name="Pink", ...}, category { Id=1,  Name="Green",  ...}]
  </code></pre>
  
  <p>So, I just need one way to get the "Pink" category if my Index is 2.</p>
  
  <p>Thank you.</p>
  
  <p>EDIT:</p>
  
  <pre><code>viewModel.addNote = function() {
      var selectedCategoryIndex = $("#Categories").val();
      var selectedCategory = ko.utils.arrayFirst(this.categories(), function(item) {
          return item.Id === selectedCategoryIndex;
      });
  
  }.bind(viewModel);
  </code></pre>