Creating Map Method in Ruby
In this guide you will alter and return values in a collection for the Array class.
Guide Tasks
  • Read Tutorial
  • Complete the Exercise

Summary

Alter and return values in a collection for the Array class using the map method.

Exercise Description

"In this exercise you will be returning values in a collection for the Array class using the map method."

Example

'arr = ['1', '2', '3']'
-> expect(arr.new_map(&:to_i)).to eq([1, 2, 3])
'arr = (1..3).to_a'

Real World Usage

This exercise will help you learn how to return values in a collection for arrays.

Test Cases

Code File