Returns a specified number of elements from the end of an array.