# \[AS2\] number of occurrences in an array

**URL:** https://forum.kirupa.com/t/as2-number-of-occurrences-in-an-array/268315
**Category:** flash
**Created:** [August 12, 2008, 2:52pm UTC](https://forum.kirupa.com/t/as2-number-of-occurrences-in-an-array/268315 "2008-08-12T14:52:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![540media](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/540media/32/2543_2.png) [@540media](https://forum.kirupa.com/u/540media)
#### Post date: [August 12, 2008, 2:52pm UTC](https://forum.kirupa.com/t/as2-number-of-occurrences-in-an-array/268315/1 "2008-08-12T14:52:18Z")

</div>

is there anyway to count the number of occurrences of an element in an array??

eg

array = (a, a, c, h, a, h, g, j, j, j)

//Number of times each element appears in the array  
a=3  
c=1  
h=2  
g=1  
j=3
