Would I be correct in saying that it was dangerous to use delete_at while iterating through an array? How about in the following situation where after the deletion, the loop and function are exited?
arr.each_index do |i|
if arr[i] == 5
arr.delete_at(i)
return
end
end
5, rather than all of them?