Skip to content

Conversation

@dmee3
Copy link

@dmee3 dmee3 commented May 18, 2017

it "should loop over the array and return a new array" do
loopy = [1,2,3]
expect(loopy._fill_in_method_here_ { |n| n + 1 }).to eq [2,3,4]
expect(loopy.map! { |n| n + 1 }).to eq [2,3,4]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map is typically preferred over map!. There's no need to modify loopy here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants