Question
What does collect do on a Scala collection?
Select an option. Your answer will be checked instantly.
Correct Answer: B. Applies a partial function to matching elements and returns the results
Explanation:
collect combines filtering and transformation.
Inputs for which the partial function is undefined are skipped.
Leave a Reply