ruby create a new array from an object value code example
Example 1: how to make a new array ruby
my_array = []
# OR
my_array = [1, 2, 3]
# OR
my_array = Array.new
#OR
(1..10).to_a
Example 2: ruby array
ary = [1, "two", 3.0] #=> [1, "two", 3.0]
my_array = []
# OR
my_array = [1, 2, 3]
# OR
my_array = Array.new
#OR
(1..10).to_a
ary = [1, "two", 3.0] #=> [1, "two", 3.0]