Answers for "how add items to array in ruby"

1

ruby append to array

array = []
array << "element 1"
array.append "element 2"
puts array

# ["element 1", "element 2"]
Posted by: Guest on March-27-2020

Browse Popular Code Answers by Language