Get the first element or first n elements of an array.