How to get the first array element in Ruby

1 Answer

0 votes
arr = ["ruby", "c++", "go", "php", "java"]

puts arr.first
puts arr[0]



# run:

# ruby
# ruby

 



answered Aug 30, 2020 by avibootz
...