T
Toby Rodwell
(Something a bit more basic than the other thread about the array shfit
bug!)
Given the following:
myArray=["a", "b", "c", "d"]
until myArray.empty?
myArray.shift { |letter|
puts letter
}
end
... I would expect the letters a, b, c and d to be printed to the
screen, but I don't get anything (including no error message). Have I
misunderstood something about array shift and/or blocks?
bug!)
Given the following:
myArray=["a", "b", "c", "d"]
until myArray.empty?
myArray.shift { |letter|
puts letter
}
end
... I would expect the letters a, b, c and d to be printed to the
screen, but I don't get anything (including no error message). Have I
misunderstood something about array shift and/or blocks?