Repetition of the js part 6 and 5

there is a repetition of the part 5&6 in the array methods