# How to check contents in arrays

**URL:** <https://forum.kirupa.com/t/how-to-check-contents-in-arrays/241158>\
**Category:** Uncategorized\
**Created:** [October 10, 2007, 4:06pm UTC](https://forum.kirupa.com/t/how-to-check-contents-in-arrays/241158 "2007-10-10T16:06:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![myoreo](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@myoreo](https://forum.kirupa.com/u/myoreo)\
**Post date:** [October 10, 2007, 4:06pm UTC](https://forum.kirupa.com/t/how-to-check-contents-in-arrays/241158/1 "2007-10-10T16:06:27Z")

</div>

hi all,  
I’m trying to do a memory game and the problem I have is I don’t know how to check the contents in the arrays.

Here’s part of the code:  
function createNewOrder() {

```
for (k=0; k&lt;=numberOfKeys; k++) {
    onEnterFrame = function () {
        randomNumber = Math.floor(Math.random()*5);
        if(isNotAssigned(randomNumber)){
        order.push(randomNumber);
        trace(order);
        } 
        if(order.length &gt;= 5){
            delete onEnterFrame;
        }
        
    };
}

```

}

function isNotAssigned(numCheck) {  
if (order !== numCheck) {//I think this part is the problem.  
return numCheck;  
}  
}

Anybody knows what I’m talking about? Perhaps I need to explain better
