# Matching items in array

**URL:** <https://forum.kirupa.com/t/matching-items-in-array/327941>\
**Category:** Uncategorized\
**Created:** [April 7, 2012, 12:53am UTC](https://forum.kirupa.com/t/matching-items-in-array/327941 "2012-04-07T00:53:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![learningas3](https://avatars.discourse-cdn.com/v4/letter/l/b5e925/32.png) [@learningas3](https://forum.kirupa.com/u/learningas3)\
**Post date:** [April 7, 2012, 12:53am UTC](https://forum.kirupa.com/t/matching-items-in-array/327941/1 "2012-04-07T00:53:12Z")

</div>

i don’t understand arrays in functions, but how do you find the matching items given in an array? for example:

var fruit:Array = [“apples”, “oranges”, “grapes”, “oranges”, “apples”, “grapes”];

how can i get it to show only the number of apples in the array?
