I am trying to figure out how to get the length of an array's value(index?) For some reason it is returning 1,0,0 and I am clueless why. Can anyone explain what I am doing wrong please? FYI this is from RubyMonk. I am trying to solve it without getting the answer..just need a little boost to figure out what im doing wrong
def length_finder(input_array)
output= []
input_array.length.times do |x|
output << input_array.length[x]
end
return output
end
Array.each, which is a cleaner way to loop through the items (although kudos on the clever use oftimes)