Beginner Swift
Q28 / 100

What are where clauses in Swift generics?

Correct! Well done.

Incorrect.

The correct answer is B) Constraints on generic type parameters: func f<T: Comparable>() where T: Hashable

B

Correct Answer

Constraints on generic type parameters: func f<T: Comparable>() where T: Hashable

Explanation

where clauses add extra type constraints. extension Array where Element: Equatable adds methods only when Element conforms to Equatable.

Progress
28/100