Mastering Enumerable, Part 1

Flashcard 4 of 7

What is the real name of mystery_method?

(1..6).mystery_method { |i| i.even? }  #=> [[2, 4, 6], [1, 3, 5]]

Another example:

names = %w(mark ben christopher joe)

names.mystery_method { |name| name.length == 3 }
#=> [["ben", "joe"], ["mark", "christopher"]]

Answer:

Reveal Answer