Daily iOS
Swift

Higher-order functions

What does this code print?

let raw = ["1", "x", "3"]
let a = raw.map { Int($0) }
let b = raw.compactMap { Int($0) }
let c = [[1, 2], [3]].flatMap { $0 }
print(a.count, b.count, c.count)

Pick one

Submit