Comparing Array values

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~