Beginner Swift
Q39 / 100

What is higher-order function map in Swift?

Correct! Well done.

Incorrect.

The correct answer is B) Applies a transformation to each element in a collection and returns a new array

B

Correct Answer

Applies a transformation to each element in a collection and returns a new array

Explanation

[1, 2, 3].map { $0 * 2 } returns [2, 4, 6]. map, filter, reduce, and flatMap are core Swift collection functions.

Progress
39/100