Intermediate
Ruby
Q72 / 100
What is the difference between "Array#map!" and "Array#map"?
Correct! Well done.
Incorrect.
The correct answer is B) map returns a new array with transformed elements, while map! mutates the original array in place and returns it
B
Correct Answer
map returns a new array with transformed elements, while map! mutates the original array in place and returns it
Explanation
Methods ending with "!" conventionally mutate the receiver in place; map! transforms and replaces the elements of the original array rather than returning a new one.
Progress
72/100