# Comparing the contents of 2 arrays

**URL:** <https://forum.kirupa.com/t/comparing-the-contents-of-2-arrays/301795>\
**Category:** Uncategorized\
**Created:** [December 15, 2009, 9:25pm UTC](https://forum.kirupa.com/t/comparing-the-contents-of-2-arrays/301795 "2009-12-15T21:25:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grandpaw\_broon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/grandpaw_broon/32/3985_2.png) [@grandpaw\_broon](https://forum.kirupa.com/u/grandpaw_broon)\
**Post date:** [December 15, 2009, 9:25pm UTC](https://forum.kirupa.com/t/comparing-the-contents-of-2-arrays/301795/1 "2009-12-15T21:25:37Z")

</div>

Hey guys, i cant seem to do this:

```auto
firstArray = new Array(item1, item2, item3, item4);
secondArray = new Array (item1, item1, item4, item2);

```

I basically need to compare the contents of these 2 arrays.

For example when im finished, id like the output to be:

```auto
//firstArray item3
//secondArray item1

```

Essentially cancelling each other out.

The situation is a girl with a tray and a table. Im comparing what is on the users tray (firstArray) with what they have ordered (secondArray).

Ill be removing the graphics from firstArray and reducing the content of the secondArray.

So i still need an item1 to complete the order.

Jesus, this “dash” game is complex for me!
