# Comparing Array values

**URL:** <https://forum.kirupa.com/t/comparing-array-values/138518>\
**Category:** Uncategorized\
**Created:** [February 23, 2005, 5:23am UTC](https://forum.kirupa.com/t/comparing-array-values/138518 "2005-02-23T05:23:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![meisme](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@meisme](https://forum.kirupa.com/u/meisme)\
**Post date:** [February 23, 2005, 5:23am UTC](https://forum.kirupa.com/t/comparing-array-values/138518/1 "2005-02-23T05:23:45Z")

</div>

I have an Array with the following values : MyArray(1,2,3,4,5,6);  
I need to compare 1 of the values inside MyArray in a if-else statement.

Example :

arrayValue = MyArray.splice(0,1);

if (arrayValue == 1) {  
//do something  
}

But this comparison doesnt work … how can i compare the value in the array …  
i need that value to do something…

Anyone can help ? Thanks~
