We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
select.map → single-pass — Chaining select + map creates two intermediate arrays. Combine into a single pass.
select
map
ary.select { |x| x > 0 }.map { |x| x * 2 }
There was an error while loading. Please reload this page.