I think it would be sensible to check that the lengths of both arrays are equal before doing any iterating. It's a cheap way to opt out of hard work early, and it fixes the following type of failure for the second approach you mention:
{1, 2, 3} seen as equal to {4, 3, 2, 1}