Logo

Programming-Idioms

History of Idiom 141 > diff from v13 to v14

Edit summary for version 14 by steenslag:
New Ruby implementation by user [steenslag]

Version 13

2019-01-08, 16:54:01

Version 14

2019-01-11, 16:17:56

Idiom #141 Iterate in sequence over two lists

Iterate in sequence over the elements of the list items1 then items2. For each iteration print the element.

Idiom #141 Iterate in sequence over two lists

Iterate in sequence over the elements of the list items1 then items2. For each iteration print the element.

Code
items1.chain(items2).each{|item| puts item}
Comments bubble
chain is added to Ruby in version 2.6