title: Count the number of times a same value appears in a javascript array
body: <p>I would like to know if there is a native javascript code that does the same thing as this:</p>
  
  <pre><code>function f(array,value){
      var n = 0;
      for(i = 0; i &lt; array.length; i++){
          if(array[i] == value){n++}
      }
      return n;
  }
  </code></pre>