3 ms·
It's interesting you mention an array and a loop, because those can be separate abstractions too. no need to think about loops: array.each {|x| puts x} need
by fouc 8y ago
It's interesting you mention an array and a loop, because those can be separate abstractions too.
no need to think about loops:
array.each {|x| puts x}
need think about loops:
for i in 0...array.length do puts array[i] end
- kbp 8y agoThe first example saves you from thinking about indexing; arrays and loops are relevant in both.