Use first(where:)
Swift
let numbers = [1, 2, 7, 3, 4, 5, 6, 7]
let firstSeven = numbers.first { $0 == 7 }
// Instead of:
// let firstSeven = numbers.filter({ $0 == 7 }).first
let numbers = [1, 2, 7, 3, 4, 5, 6, 7]
let firstSeven = numbers.first { $0 == 7 }
// Instead of:
// let firstSeven = numbers.filter({ $0 == 7 }).first