seq.sum - sum of elements.
public protocol Sequence { associatedtype Element associatedtype Iterator: IteratorProtocol where Iterator.Element == Element func makeIterator() -> Iterator // other requirements ... }
Swift ⟩ Sequence
類似 JS 的 iterable protocol
Last updated 3 years ago
Was this helpful?