Hey everyone, I’m super new to ruby, and I am having trouble with a
method that I wrote using each_with_index method.
I created a method so that I can get the index of an element in the
argument array. Not only do I want to know the value of the element that
I’m looping over, but I also want to know the position in the
collection. I wrote a method called add_value_and_index, that takes an
array of numbers and returns a new array (empty set) composed of
value-plus-the-index of each element in the argument array.
Can someone look over and provide feedback please? Thank you.