Greetings!
When assigning a value to an array as in the following, how could I replace the nils by 0?
nil
0
array = [1,2,3] array
nil.to_i is 0, if all the numbers are integers then below should work. I think It is also the shortest answer here.
array.map!(&:to_i)