Arrays are objects, so if you use ==, it will compare if those two arrays are the same object (which they almost certainly aren't) instead of comparing if they have the same contents (which is what you want to do). Instead, loop over the arrays, comparing corresponding elements. If they're all the same, the arrays are the same.