The function reverses the order of elements in an array.