commonEnd: same first or same last?

Given 2 arrays of ints, a and b, return true if they have the same first element or the same last element. Both arrays will be length 1 or more. Step through commonEnd: the arrays can be different lengths, so each one finds its own last index with .length-1.