Use number from input to array access position
EDIT: first part removed, I found the answer.
I have the following problem: im reading a number from input and trying to use that number to access a given array position. I am getting the following results
value #=> "0"
value.to_i #=> 0
myArray[0] #=> MyObject
myArray[value.to_i] #=> nil
-1
a source to share
3 answers