# Finding Any Value in Array (not indexOf)

**URL:** <https://forum.kirupa.com/t/finding-any-value-in-array-not-indexof/160475>\
**Category:** flash\
**Created:** [August 26, 2005, 4:56am UTC](https://forum.kirupa.com/t/finding-any-value-in-array-not-indexof/160475 "2005-08-26T04:56:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [August 26, 2005, 4:56am UTC](https://forum.kirupa.com/t/finding-any-value-in-array-not-indexof/160475/1 "2005-08-26T04:56:02Z")

</div>

Hi everyone,  
I am wondering if Flash has a built in way of finding if a value in an array exists. IndexOf only works with string values, but I couldn’t find any function that tries to find a value of any data type in an array.

If there isn’t one, I will just end up using this:

```auto
contains = function (array, input) {
for (i=0; i<array.length; i++) {
if (array* == input) {
return 1;
}
}
};

```

I am trying not to use my own functions for things that Flash already has built-in, so I just want to double check with you all in case I missed something 🙂

Thanks!  
Kirupa :beam:
