élément de remplacement du tableau rubis

p array.map { |x| x == 4 ? 'Z' : x }

# => [1, 2, 3, 'Z']
Fancy Ferret