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
let a: [Int] = [0, 0, 1, 1, 2, 2, 3, 3, 4] let b: [Int] = Array(a.prefix(5)) // result is [0, 0, 1, 1, 2]