In Swift, is there a clever way of using the higher order methods on Array to return the 5 first objects? The obj-c way of doing it was saving an index, and for-loop throug
Swift 4
To get the first N elements of a Swift array you can use prefix(_ maxLength: Int):
prefix(_ maxLength: Int)
Array(largeArray.prefix(5))