DEV Community

loading...

Discussion on: Daily Challenge #172 - Find All in an Array

Collapse
cipharius profile image
Valts Liepiņš

Ruby

def findAll xs, x
    xs.filter_map.with_index {|y, i| i if x == y}
end