Use map to create a new array from the old one:
arr2 = arr.map {|item| item * 3}
Use map! to modify the array in place:
arr.map! {|item| item * 3}
See it working online: ideone
Use map to create a new array from the old one:
arr2 = arr.map {|item| item * 3}
Use map! to modify the array in place:
arr.map! {|item| item * 3}
See it working online: ideone