Sesame-iOS/Sesame/Extensions/Array+Extensions.swift
2023-08-14 10:39:29 +02:00

15 lines
264 B
Swift

import Foundation
extension Array {
func count(where closure: (Element) -> Bool) -> Int {
var result = 0
forEach { element in
if closure(element) {
result += 1
}
}
return result
}
}