# Comparing Array Items AS3

**URL:** <https://forum.kirupa.com/t/comparing-array-items-as3/315778>\
**Category:** flash\
**Created:** [November 3, 2010, 8:07pm UTC](https://forum.kirupa.com/t/comparing-array-items-as3/315778 "2010-11-03T20:07:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NekoAthena](https://avatars.discourse-cdn.com/v4/letter/n/ba9def/32.png) [@NekoAthena](https://forum.kirupa.com/u/NekoAthena)\
**Post date:** [November 3, 2010, 8:07pm UTC](https://forum.kirupa.com/t/comparing-array-items-as3/315778/1 "2010-11-03T20:07:16Z")

</div>

here i am again with another probably-silly question. i am trying to compare arrays so that if any elements of one array are found within the second, then one condition of the if… else is triggered. basically, one array is itemAnswers, the answers the user has given and dynamically pushed to the array (this part works). the second is wrongAnswers, since full credit is only given if all correct answers are present and no wrong answers. here is what i’ve got so far:

```auto

var itemAnswers:Array = new Array;
var wrongAnswers:Array = [slipperyW, hillW];

if (itemAnswers != wrongAnswers)
    {
        road_response.text = "Good Job!";
        MovieClip(parent).numberCorrect ++;
    }
    else
    {
        road_response.text = "Wrong Answer!";
    }

```

i have also tried it with an array of righAnswers, and this statement:

```auto
if (itemAnswers = rightAnswers && itemAnswers != wrongAnswers)

```

but i get the implicit coercion error for the boolean.

i just want to make sure none of the items in the array wrongAnswers appear in the array itemAnswers.

i have been searching, but haven’t found anything specific to what i am trying to do and am stuck. I am new to arrays.

Thanks for reading!
