# Splat and double Splat operators # with objects obj1 = { a: 'a', b: 'b' } obj2 = { **obj1, c: 'c' } # {:a=>"a", :b=>"b", :c=>"c"} # with arrays array1 = %w[a b c] array2 = [*array1, 'd'] # ["a", "b", "c", "d"]
# Splat and double Splat operators # with objects obj1 = { a: 'a', b: 'b' } obj2 = { **obj1, c: 'c' } # {:a=>"a", :b=>"b", :c=>"c"} # with arrays array1 = %w[a b c] array2 = [*array1, 'd'] # ["a", "b", "c", "d"]