Using the map method – part 1
In the next few sections, we are going to cover the map
method, which is a popular iteration method used by Ruby developers on a regular basis due to its flexibility and usefulness.
For this guide, I'm going to use the irb
environment to show you the different environments available for Ruby. If you want to use this environment too, simply type irb
in your Terminal. Alternatively, you can also use repl.it if you prefer.
This is how you can access Interactive Ruby Shell (irb):

The map method code example
You are going to learn how to use the map
method with a practical example. Let's imagine that we have an array of strings that represent numbers. This is a common occurrence in Ruby when you work with APIs since they always return values in a string format (even numbers). In cases like these, you may want to convert the values into actual integer data types so that you can use them in your application. This is a great example of how you can leverage the map
method...