Skip to content
RED SAG Skills
mediumStudy question · answer published in Swift interview questions, so no pointsswiftgenerics

Constraining a generic function

What does this function require of T?

func largest<T>(_ items: [T]) -> T? where T: Comparable {
    items.max()
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions