title: ActionScript 3.0 - get the count of the same value in an array
body: <p>working in actionscript3 and have an array problem.
  I have an array containing numbers, [1,2,3,4,2,1,2,3,4]</p>
  
  <p>how to count number of one value, like the  array. <code>count function ["4"] //2</code></p>
  
  <p>can make an for loop, but like a function for an more easy code.</p>
  
  <pre><code>for(var k:uint = 0; k &lt; array.length; k++)
  {
      if (array[k] =="4")
      {
          newarray.push(array[k]);
      }
  
  }
  trace(array.length);
  </code></pre>
  
  <p>thanks for help!</p>