Subscript with default arguments

Swift

Swift 5.2 added subscript with default arguments, it gets quite powerful for custom subscripts, but also default ones like in this example
var counts: [Int: Int] = [:] let numbers = [1, 2, 3, 1, 2, 1, 3] numbers.forEach { number in counts[number, default: 0] += 1 } print(counts) // [1: 3, 2: 2, 3: 2] print(counts[5, default: 0]) // 0 (non-optional)