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