title: Counting occurrences of particular property value in array of objects
body: <p>I would like to know how i can count the number of occurences on an array of object like this one :</p>
  
  <pre><code>[
  {id : 12,
   name : toto,
  },
  {id : 12,
   name : toto,
  },
  {id : 42,
   name : tutu,
  },
  {id : 12,
   name : toto,
  },
  ]
  </code></pre>
  
  <p>in this case i would like to have a function who give me this : </p>
  
  <pre><code>getNbOccur(id){
  //don't know...//
  
  return occurs;
  }
  </code></pre>
  
  <p>and if i give the id 12 i would like to have 3.</p>
  
  <p>How can i do that?</p>